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:
parent
37a70c0ff1
commit
3fe3b558d7
1 changed files with 31 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue