From 3fe3b558d7ab5a02af60ce6a8eae4bee4e120c59 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Feb 2026 20:58:29 +0000 Subject: [PATCH] test(chain): verify ring signatures during full chain sync All pre-HF4 spending transactions on testnet pass NLSAG ring signature verification end-to-end. Co-Authored-By: Charon --- chain/integration_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/chain/integration_test.go b/chain/integration_test.go index 3d74593..02c6353 100644 --- a/chain/integration_test.go +++ b/chain/integration_test.go @@ -131,3 +131,34 @@ func TestIntegration_SyncToTip(t *testing.T) { expectedHash, _ := types.HashFromHex(GenesisHash) require.Equal(t, expectedHash, genMeta.Hash) } + +func TestIntegration_SyncWithSignatures(t *testing.T) { + if testing.Short() { + t.Skip("skipping long sync test in short mode") + } + + client := rpc.NewClientWithHTTP(testnetRPCAddr, &http.Client{Timeout: 60 * time.Second}) + + remoteHeight, err := client.GetHeight() + if err != nil { + t.Skipf("testnet daemon not reachable: %v", err) + } + + s, err := store.New(":memory:") + require.NoError(t, err) + defer s.Close() + + c := New(s) + + opts := SyncOptions{ + VerifySignatures: true, + Forks: config.TestnetForks, + } + + err = c.Sync(context.Background(), client, opts) + require.NoError(t, err) + + finalHeight, _ := c.Height() + t.Logf("synced %d blocks with signature verification", finalHeight) + require.Equal(t, remoteHeight, finalHeight) +}