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 <charon@lethean.io>
This commit is contained in:
Claude 2026-02-21 20:58:29 +00:00
parent 37a70c0ff1
commit 3fe3b558d7
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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)
}