test(core): align helpers with current APIs
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-04 22:04:52 +00:00
parent 0512861330
commit 8802b94ee5
2 changed files with 8 additions and 4 deletions

View file

@ -738,6 +738,10 @@ func TestSync_Bad_InvalidBlockBlob(t *testing.T) {
func TestSync_Bad_PreHardforkFreeze(t *testing.T) { func TestSync_Bad_PreHardforkFreeze(t *testing.T) {
genesisBlob, genesisHash := makeGenesisBlockBlob() genesisBlob, genesisHash := makeGenesisBlockBlob()
genesisBytes, err := hex.DecodeString(genesisBlob)
if err != nil {
t.Fatalf("decode genesis blob: %v", err)
}
regularTx := types.Transaction{ regularTx := types.Transaction{
Version: 1, Version: 1,
@ -800,11 +804,11 @@ func TestSync_Bad_PreHardforkFreeze(t *testing.T) {
}, },
} }
if err := c.processBlockBlobs(genesisBlob, nil, 0, 1, opts); err != nil { if err := c.processBlockBlobs(genesisBytes, nil, 0, 1, opts); err != nil {
t.Fatalf("process genesis: %v", err) t.Fatalf("process genesis: %v", err)
} }
err := c.processBlockBlobs(block1Blob, [][]byte{regularTxBlob}, 1, 100, opts) err = c.processBlockBlobs(block1Blob, [][]byte{regularTxBlob}, 1, 100, opts)
if err == nil { if err == nil {
t.Fatal("expected freeze rejection, got nil") t.Fatal("expected freeze rejection, got nil")
} }

View file

@ -48,7 +48,7 @@ func TestVerifyV1Signatures_Good_MockRing(t *testing.T) {
tx.Signatures = [][]types.Signature{make([]types.Signature, 1)} tx.Signatures = [][]types.Signature{make([]types.Signature, 1)}
tx.Signatures[0][0] = types.Signature(sigs[0]) tx.Signatures[0][0] = types.Signature(sigs[0])
getRing := func(amount uint64, offsets []uint64) ([]types.PublicKey, error) { getRing := func(height, amount uint64, offsets []uint64) ([]types.PublicKey, error) {
return []types.PublicKey{types.PublicKey(pub)}, nil return []types.PublicKey{types.PublicKey(pub)}, nil
} }
@ -82,7 +82,7 @@ func TestVerifyV1Signatures_Bad_WrongSig(t *testing.T) {
}, },
} }
getRing := func(amount uint64, offsets []uint64) ([]types.PublicKey, error) { getRing := func(height, amount uint64, offsets []uint64) ([]types.PublicKey, error) {
return []types.PublicKey{types.PublicKey(pub)}, nil return []types.PublicKey{types.PublicKey(pub)}, nil
} }