feat(gl): add immutable postgres ledger storage
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInitialMigrationContainsLedgerSafetyGuards(t *testing.T) {
|
||||
contents, err := migrationFiles.ReadFile("migrations/000001_init.up.sql")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
schema := string(contents)
|
||||
for _, required := range []string{
|
||||
"amount numeric(38, 18)",
|
||||
"idempotency_key text NOT NULL UNIQUE",
|
||||
"guard_journal_seal",
|
||||
"journal is not balanced per asset",
|
||||
"cannot append to a sealed journal",
|
||||
"reject_ledger_mutation",
|
||||
} {
|
||||
if !strings.Contains(schema, required) {
|
||||
t.Fatalf("migration is missing %q", required)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user