diff --git a/adapters/sn2core/sn2core.go b/adapters/sn2core/sn2core.go index f6d8d48755..bd46e52c43 100644 --- a/adapters/sn2core/sn2core.go +++ b/adapters/sn2core/sn2core.go @@ -14,7 +14,7 @@ import ( "github.com/ethereum/go-ethereum/common" ) -func AdaptBlock(response *starknet.Block, sig *starknet.Signature) (*core.Block, error) { +func AdaptBlock(response *starknet.Block, sig []*felt.Felt) (*core.Block, error) { if response == nil { return nil, errors.New("nil client block") } @@ -37,7 +37,7 @@ func AdaptBlock(response *starknet.Block, sig *starknet.Signature) (*core.Block, sigs := [][]*felt.Felt{} if sig != nil { - sigs = append(sigs, sig.Signature) + sigs = append(sigs, sig) } return &core.Block{ diff --git a/adapters/sn2core/sn2core_test.go b/adapters/sn2core/sn2core_test.go index 4135d0deb8..4cb929e87b 100644 --- a/adapters/sn2core/sn2core_test.go +++ b/adapters/sn2core/sn2core_test.go @@ -103,7 +103,12 @@ func TestAdaptBlock(t *testing.T) { response, err := client.Block(ctx, strconv.FormatUint(test.number, 10)) require.NoError(t, err) - block, err := sn2core.AdaptBlock(response, test.sig) + + var sig []*felt.Felt + if test.sig != nil { + sig = test.sig.Signature + } + block, err := sn2core.AdaptBlock(response, sig) require.NoError(t, err) expectedEventCount := uint64(0) diff --git a/clients/feeder/feeder.go b/clients/feeder/feeder.go index 16b02ffd59..ca7a8f8df1 100644 --- a/clients/feeder/feeder.go +++ b/clients/feeder/feeder.go @@ -6,6 +6,7 @@ import ( "errors" "io" "net/http" + "strconv" "sync/atomic" "time" @@ -382,10 +383,15 @@ func (c *Client) Signature(ctx context.Context, blockID string) (*starknet.Signa return signature, nil } -func (c *Client) StateUpdateWithBlock(ctx context.Context, blockID string) (*starknet.StateUpdateWithBlock, error) { +func (c *Client) StateUpdateWithBlock( + ctx context.Context, + blockID string, + includeSignature bool, +) (*starknet.StateUpdateWithBlock, error) { queryURL := c.buildQueryString("get_state_update", map[string]string{ - blockNumberArg: blockID, - "includeBlock": "true", + blockNumberArg: blockID, + "includeBlock": "true", + "includeSignature": strconv.FormatBool(includeSignature), }) body, err := c.get(ctx, queryURL) diff --git a/clients/feeder/feeder_test.go b/clients/feeder/feeder_test.go index f493eda046..5728b118b6 100644 --- a/clients/feeder/feeder_test.go +++ b/clients/feeder/feeder_test.go @@ -1011,7 +1011,7 @@ func TestStateUpdateWithBlock(t *testing.T) { client := feeder.NewTestClient(t, &networks.Integration) t.Run("Test normal case", func(t *testing.T) { - actualStateUpdate, err := client.StateUpdateWithBlock(t.Context(), strconv.Itoa(0)) + actualStateUpdate, err := client.StateUpdateWithBlock(t.Context(), strconv.Itoa(0), false) assert.NoError(t, err) assert.Equal( t, @@ -1038,16 +1038,35 @@ func TestStateUpdateWithBlock(t *testing.T) { assert.Empty(t, actualStateUpdate.StateUpdate.StateDiff.Nonces) assert.Empty(t, actualStateUpdate.StateUpdate.StateDiff.DeclaredClasses) }) + t.Run("Test with includeSignature", func(t *testing.T) { + actualStateUpdate, err := client.StateUpdateWithBlock(t.Context(), strconv.Itoa(78541), true) + assert.NoError(t, err) + assert.NotEmpty(t, actualStateUpdate.StateUpdate) + assert.NotEmpty(t, actualStateUpdate.Block) + assert.NotEmpty(t, actualStateUpdate.Signature) + assert.Equal(t, 2, len(actualStateUpdate.Signature)) + assert.Equal( + t, + "0xe59046f297679492dec6987bf580707fc7a438bd3da98b9c73a6e495d915d", + actualStateUpdate.Signature[0].String(), + ) + assert.Equal( + t, + "0x23e7e5fddc5e6be25f264e8571f98948600be4768a9f6ab7406ef1ef3da43c3", + actualStateUpdate.Signature[1].String(), + ) + }) t.Run("Test on unexisting block", func(t *testing.T) { actualStateUpdate, err := client.StateUpdateWithBlock( t.Context(), strconv.Itoa(10000000000), + false, ) assert.Error(t, err) assert.Nil(t, actualStateUpdate) }) t.Run("Test on latest block", func(t *testing.T) { - actualStateUpdate, err := client.StateUpdateWithBlock(t.Context(), "latest") + actualStateUpdate, err := client.StateUpdateWithBlock(t.Context(), "latest", false) assert.NoError(t, err) assert.NotNil(t, actualStateUpdate) }) diff --git a/clients/feeder/testdata/integration/state_update_with_block/0.json b/clients/feeder/testdata/integration/state_update_with_block/0.json index 887fe9d18b..ea84eac655 100644 --- a/clients/feeder/testdata/integration/state_update_with_block/0.json +++ b/clients/feeder/testdata/integration/state_update_with_block/0.json @@ -188,5 +188,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x4ad6fcb4adc8f45ab532267a878cade0e576300fbd1bfcafac48c9b367ed53d", + "0x54d3cd3d76a3a1db3b8d4a934a5c15d4ca3de771146675f744b471104d5d138" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/integration/state_update_with_block/1.json b/clients/feeder/testdata/integration/state_update_with_block/1.json index aa7c70fd7a..aa01e42565 100644 --- a/clients/feeder/testdata/integration/state_update_with_block/1.json +++ b/clients/feeder/testdata/integration/state_update_with_block/1.json @@ -197,5 +197,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x7fe660044180e7d436e77ab017faff0686c0b02a425ade81de8fd5aa95663bb", + "0xc475f270d1e6d735829ac7db0c7580f86b8f788e44106220312125496d1931" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/integration/state_update_with_block/283364.json b/clients/feeder/testdata/integration/state_update_with_block/283364.json index e09519f56b..0faf744a6a 100644 --- a/clients/feeder/testdata/integration/state_update_with_block/283364.json +++ b/clients/feeder/testdata/integration/state_update_with_block/283364.json @@ -448,5 +448,9 @@ ], "replaced_classes": [] } - } + }, + "signature": [ + "0x405a7a6641a0c5990db264b67676e6bde816716be5665790bb314c80ca9f5f0", + "0x2665b141b14b80a3f96d7487665b49dba53d2a873a8d45561bfefd9499ca10a" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/integration/state_update_with_block/78541.json b/clients/feeder/testdata/integration/state_update_with_block/78541.json index 6c10887086..3a4bbdc8eb 100644 --- a/clients/feeder/testdata/integration/state_update_with_block/78541.json +++ b/clients/feeder/testdata/integration/state_update_with_block/78541.json @@ -1347,5 +1347,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0xe59046f297679492dec6987bf580707fc7a438bd3da98b9c73a6e495d915d", + "0x23e7e5fddc5e6be25f264e8571f98948600be4768a9f6ab7406ef1ef3da43c3" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/mainnet/state_update_with_block/0.json b/clients/feeder/testdata/mainnet/state_update_with_block/0.json index 491022297a..2c604d5abf 100644 --- a/clients/feeder/testdata/mainnet/state_update_with_block/0.json +++ b/clients/feeder/testdata/mainnet/state_update_with_block/0.json @@ -760,5 +760,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x484a36b518e33198bfe7a29d82842ae092f9181120e1d49b926c651adf315ed", + "0x7e21090ab0c6c70fa2b73e17e6288db298dbe191b04bfd1721436530e84861e" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/mainnet/state_update_with_block/1.json b/clients/feeder/testdata/mainnet/state_update_with_block/1.json index cc77c6fb67..a382ff55d9 100644 --- a/clients/feeder/testdata/mainnet/state_update_with_block/1.json +++ b/clients/feeder/testdata/mainnet/state_update_with_block/1.json @@ -364,5 +364,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x5c328d673c07e530a45d6f12e569df0d059d97bf920d978e44daa54fb3db655", + "0x37feba468c96099a9a610c34bab6230af8c7e9d78c1ddb7436488961fc5161d" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/mainnet/state_update_with_block/16697.json b/clients/feeder/testdata/mainnet/state_update_with_block/16697.json index ef2b713cfb..b41ab30266 100644 --- a/clients/feeder/testdata/mainnet/state_update_with_block/16697.json +++ b/clients/feeder/testdata/mainnet/state_update_with_block/16697.json @@ -393,5 +393,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x2fb6fa73bf46ede7240e5034d8ce28ef63e90b3475f476d1ebb89bf3da04725", + "0x46e54ef8121fb3a69989329cbe993602534ff27c7330a4d92bcfc697cac5678" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/mainnet/state_update_with_block/2.json b/clients/feeder/testdata/mainnet/state_update_with_block/2.json index 2bfd867f24..1f91e4c61f 100644 --- a/clients/feeder/testdata/mainnet/state_update_with_block/2.json +++ b/clients/feeder/testdata/mainnet/state_update_with_block/2.json @@ -276,5 +276,9 @@ "declared_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x4009f6bce4d9c392b031dd335777dd4b425b3c1da9d82b9b2a4aec3b7b77fd4", + "0x654baea62f7d9f90cdcb1623428b7f437eb45aa880c5c628c6ba77aa9370ee" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia-integration/state_update_with_block/1164618.json b/clients/feeder/testdata/sepolia-integration/state_update_with_block/1164618.json index a78393ef90..6d26dfa64c 100644 --- a/clients/feeder/testdata/sepolia-integration/state_update_with_block/1164618.json +++ b/clients/feeder/testdata/sepolia-integration/state_update_with_block/1164618.json @@ -1335,5 +1335,9 @@ "declared_classes": [], "replaced_classes": [] } - } -} + }, + "signature": [ + "0x6c760ac701b4d13810fb31f513518ce9a2dcd8cf33e60d688b30876e93ca3f5", + "0x10c44d9764842557f1eb8e98a870710ac8a6e15928e67b7fb5f520861d5c0b0" + ] +} \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia-integration/state_update_with_block/16350.json b/clients/feeder/testdata/sepolia-integration/state_update_with_block/16350.json index 265034057d..c5ef56c3f3 100644 --- a/clients/feeder/testdata/sepolia-integration/state_update_with_block/16350.json +++ b/clients/feeder/testdata/sepolia-integration/state_update_with_block/16350.json @@ -11481,5 +11481,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x7ee8a86cd921053e037181b4b57b813db63b88ad5a5975ecada151d079322ae", + "0x6f97aefb8f14351f8a60f66c936ab8175744217522d7b335deadae8a4f15c68" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/0.json b/clients/feeder/testdata/sepolia/state_update_with_block/0.json index fdc36a9464..e58f13382d 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/0.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/0.json @@ -365,5 +365,9 @@ "declared_classes": [], "replaced_classes": [] } - } -} + }, + "signature": [ + "0x30a199364f1cec47d386da1839015413a464456ca6d63d6f45156d0a1254356", + "0x784aba6f4948a6a1caa4f7247adcabdfe41a8ec21668c30621cd9d265516dc6" + ] +} \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/1.json b/clients/feeder/testdata/sepolia/state_update_with_block/1.json index e103323b36..6497c44291 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/1.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/1.json @@ -64,5 +64,9 @@ "declared_classes": [], "replaced_classes": [] } - } -} + }, + "signature": [ + "0x47fe7aea2435f8be68f0dce8f859f0f2f31db43eddc9269a200ef7a530e34a0", + "0x636260cd4a8a9991a9a2f7b09a4d8ebdfbfdb7d32d0a2b8e23d8ebc0ae014dc" + ] +} \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/4072139.json b/clients/feeder/testdata/sepolia/state_update_with_block/4072139.json index fbf52a03f2..8a0cead191 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/4072139.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/4072139.json @@ -314,5 +314,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } -} + }, + "signature": [ + "0x711dcda18cd159c7372ab2d82d15534ea42d1e2317fc93426506daf492755b0", + "0x3898b1c5e8d76243b608e767981f1fd50ed894cbd7d85afdc1c108f76bdfc10" + ] +} \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/56377.json b/clients/feeder/testdata/sepolia/state_update_with_block/56377.json index 8745d0b887..e0be8c5aa8 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/56377.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/56377.json @@ -7141,5 +7141,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x27901a327fc1b9990874ed5d06f16f02440b6a1ef605e13943f9fb32743faa8", + "0x186003cc2cea1204343e62bc160ec3ac5ea6eb563d487f87a866ec0f477b57e" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/56378.json b/clients/feeder/testdata/sepolia/state_update_with_block/56378.json index acd0ffa81c..2fd72666fd 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/56378.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/56378.json @@ -9418,5 +9418,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x1847649e0ee0e556f130034d32fdcdff7aa0131a77c9f644f5fda7bc17365d7", + "0x2e9dd9a40897a40038c7f34328c4d1eb9aadd0c8c861b88d2bc840e092444e4" + ] } \ No newline at end of file diff --git a/clients/feeder/testdata/sepolia/state_update_with_block/56379.json b/clients/feeder/testdata/sepolia/state_update_with_block/56379.json index f28e7810eb..13eacda2e9 100644 --- a/clients/feeder/testdata/sepolia/state_update_with_block/56379.json +++ b/clients/feeder/testdata/sepolia/state_update_with_block/56379.json @@ -7629,5 +7629,9 @@ "migrated_compiled_classes": [], "replaced_classes": [] } - } + }, + "signature": [ + "0x36e42e560b5ceb08058c61f647cd588b64e6ef45b80ff6ec38253ed7edd2c53", + "0x601931568533df6b870573c1fd76eab74c7e8f9c7b260361b6e84cd85a70630" + ] } \ No newline at end of file diff --git a/consensus/p2p/validator/fixtures_test.go b/consensus/p2p/validator/fixtures_test.go index d4ee32f239..97896ebe29 100644 --- a/consensus/p2p/validator/fixtures_test.go +++ b/consensus/p2p/validator/fixtures_test.go @@ -89,7 +89,11 @@ func BuildTestFixture( client := feeder.NewTestClient(t, testCase.Network) gw := adaptfeeder.New(client) - rawStateUpdate, err := client.StateUpdateWithBlock(t.Context(), fmt.Sprintf("%d", testCase.Height)) + rawStateUpdate, err := client.StateUpdateWithBlock( + t.Context(), + fmt.Sprintf("%d", testCase.Height), + false, + ) require.NoError(t, err) stateUpdate, block, err := gw.StateUpdateWithBlock(t.Context(), uint64(testCase.Height)) diff --git a/rpc/v10/subscriptions_test.go b/rpc/v10/subscriptions_test.go index 7837c8f6d2..15a0cac1de 100644 --- a/rpc/v10/subscriptions_test.go +++ b/rpc/v10/subscriptions_test.go @@ -3258,7 +3258,7 @@ func GetTestBlockWithCommitments( t.Helper() blockID := strconv.FormatUint(blockNumber, 10) - blockWithStateUpdate, err := client.StateUpdateWithBlock(t.Context(), blockID) + blockWithStateUpdate, err := client.StateUpdateWithBlock(t.Context(), blockID, false) require.NoError(t, err) sig, err := client.Signature(t.Context(), blockID) @@ -3266,7 +3266,7 @@ func GetTestBlockWithCommitments( adaptedState, err := sn2core.AdaptStateUpdate(blockWithStateUpdate.StateUpdate) require.NoError(t, err) - adaptedBlock, err := sn2core.AdaptBlock(blockWithStateUpdate.Block, sig) + adaptedBlock, err := sn2core.AdaptBlock(blockWithStateUpdate.Block, sig.Signature) require.NoError(t, err) commitments := &core.BlockCommitments{ diff --git a/starknet/state_update.go b/starknet/state_update.go index a4cdf19368..2c98bbbe68 100644 --- a/starknet/state_update.go +++ b/starknet/state_update.go @@ -54,8 +54,13 @@ type StateDiff struct { } `json:"migrated_compiled_classes"` } -// StateUpdateWithBlock object returned by the feeder in JSON format for "get_state_update" endpoint with includingBlock arg +// StateUpdateWithBlock represents the object response by the feeder for "get_state_update" +// endpoint with `includeBlock` and `includeSignature` arguments type StateUpdateWithBlock struct { - Block *Block `json:"block"` StateUpdate *StateUpdate `json:"state_update"` + + // Only present if `includeBlock` argument is set to `true` + Block *Block `json:"block"` + // Only present if `includeSignature` argument is set to `true` + Signature []*felt.Felt `json:"signature"` } diff --git a/starknetdata/feeder/feeder.go b/starknetdata/feeder/feeder.go index c425f92e14..698d27353d 100644 --- a/starknetdata/feeder/feeder.go +++ b/starknetdata/feeder/feeder.go @@ -81,7 +81,7 @@ func (f *Feeder) block(ctx context.Context, blockID string) (*core.Block, error) } } - return sn2core.AdaptBlock(response, sig) + return sn2core.AdaptBlock(response, sig.Signature) } // Deprecated: Transaction gets the transaction for a given transaction hash from the feeder, @@ -144,8 +144,12 @@ func (f *Feeder) StateUpdatePending(ctx context.Context) (*core.StateUpdate, err return f.stateUpdate(ctx, pendingID) } -func (f *Feeder) stateUpdateWithBlock(ctx context.Context, blockID string) (*core.StateUpdate, *core.Block, error) { - response, err := f.client.StateUpdateWithBlock(ctx, blockID) +func (f *Feeder) stateUpdateWithBlock( + ctx context.Context, + blockID string, + includeSignature bool, +) (*core.StateUpdate, *core.Block, error) { + response, err := f.client.StateUpdateWithBlock(ctx, blockID, includeSignature) if err != nil { return nil, nil, err } @@ -154,14 +158,6 @@ func (f *Feeder) stateUpdateWithBlock(ctx context.Context, blockID string) (*cor return nil, nil, errors.New("no pending block") } - var sig *starknet.Signature - if blockID != pendingID { - sig, err = f.client.Signature(ctx, blockID) - if err != nil { - return nil, nil, err - } - } - var adaptedState *core.StateUpdate var adaptedBlock *core.Block @@ -169,7 +165,7 @@ func (f *Feeder) stateUpdateWithBlock(ctx context.Context, blockID string) (*cor return nil, nil, err } - if adaptedBlock, err = sn2core.AdaptBlock(response.Block, sig); err != nil { + if adaptedBlock, err = sn2core.AdaptBlock(response.Block, response.Signature); err != nil { return nil, nil, err } @@ -181,7 +177,7 @@ func (f *Feeder) stateUpdateWithBlock(ctx context.Context, blockID string) (*cor func (f *Feeder) StateUpdatePendingWithBlock( ctx context.Context, ) (*core.StateUpdate, *core.Block, error) { - return f.stateUpdateWithBlock(ctx, pendingID) + return f.stateUpdateWithBlock(ctx, pendingID, false) } // StateUpdateWithBlock gets both state update and block for a given block number from the feeder, @@ -190,7 +186,7 @@ func (f *Feeder) StateUpdateWithBlock( ctx context.Context, blockNumber uint64, ) (*core.StateUpdate, *core.Block, error) { - return f.stateUpdateWithBlock(ctx, strconv.FormatUint(blockNumber, 10)) + return f.stateUpdateWithBlock(ctx, strconv.FormatUint(blockNumber, 10), true) } // PreConfirmedWithBlockByNumber gets both pending state update and pending block from the feeder, diff --git a/starknetdata/feeder/feeder_test.go b/starknetdata/feeder/feeder_test.go index 7f7f15e392..0417f557fe 100644 --- a/starknetdata/feeder/feeder_test.go +++ b/starknetdata/feeder/feeder_test.go @@ -30,7 +30,7 @@ func TestBlockByNumber(t *testing.T) { require.NoError(t, err) block, err := adapter.BlockByNumber(ctx, number) require.NoError(t, err) - adaptedResponse, err := sn2core.AdaptBlock(response, sig) + adaptedResponse, err := sn2core.AdaptBlock(response, sig.Signature) require.NoError(t, err) assert.Equal(t, adaptedResponse, block) }) @@ -48,7 +48,7 @@ func TestBlockLatest(t *testing.T) { require.NoError(t, err) block, err := adapter.BlockLatest(ctx) require.NoError(t, err) - adaptedResponse, err := sn2core.AdaptBlock(response, sig) + adaptedResponse, err := sn2core.AdaptBlock(response, sig.Signature) require.NoError(t, err) assert.Equal(t, adaptedResponse, block) } @@ -243,21 +243,23 @@ func TestStateUpdateWithBlock(t *testing.T) { ctx := t.Context() for _, number := range numbers { - numberStr := strconv.FormatUint(number, 10) - t.Run("integration block number "+numberStr, func(t *testing.T) { - response, err := client.StateUpdateWithBlock(ctx, numberStr) - require.NoError(t, err) - sig, err := client.Signature(ctx, numberStr) - require.NoError(t, err) - stateUpdate, block, err := adapter.StateUpdateWithBlock(ctx, number) - require.NoError(t, err) - adaptedBlock, err := sn2core.AdaptBlock(response.Block, sig) - require.NoError(t, err) - adaptedStateUpdate, err := sn2core.AdaptStateUpdate(response.StateUpdate) - require.NoError(t, err) - assert.Equal(t, block, adaptedBlock) - assert.Equal(t, stateUpdate, adaptedStateUpdate) - }) + for _, includeSignature := range [2]bool{false, true} { + numberStr := strconv.FormatUint(number, 10) + t.Run("integration block number "+numberStr, func(t *testing.T) { + response, err := client.StateUpdateWithBlock(ctx, numberStr, includeSignature) + require.NoError(t, err) + sig, err := client.Signature(ctx, numberStr) + require.NoError(t, err) + stateUpdate, block, err := adapter.StateUpdateWithBlock(ctx, number) + require.NoError(t, err) + adaptedBlock, err := sn2core.AdaptBlock(response.Block, sig.Signature) + require.NoError(t, err) + adaptedStateUpdate, err := sn2core.AdaptStateUpdate(response.StateUpdate) + require.NoError(t, err) + assert.Equal(t, block, adaptedBlock) + assert.Equal(t, stateUpdate, adaptedStateUpdate) + }) + } } } @@ -266,7 +268,7 @@ func TestStateUpdatePendingWithBlock(t *testing.T) { adapter := adaptfeeder.New(client) ctx := t.Context() - response, err := client.StateUpdateWithBlock(ctx, "pending") + response, err := client.StateUpdateWithBlock(ctx, "pending", false) require.NoError(t, err) adaptedBlock, err := sn2core.AdaptBlock(response.Block, nil) require.NoError(t, err)