diff --git a/pkg/services/rpcsrv/server_test.go b/pkg/services/rpcsrv/server_test.go index 5dc703f..678ba52 100644 --- a/pkg/services/rpcsrv/server_test.go +++ b/pkg/services/rpcsrv/server_test.go @@ -3100,12 +3100,12 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) [] require.NoError(t, json.Unmarshal(res, actual)) checkNep17TransfersAux(t, e, actual, sent, rcvd) } - t.Run("time frame only", func(t *testing.T) { testNEP17T(t, 4, 5, 0, 0, []int{20, 21, 22, 23}, []int{3, 4}) }) + t.Run("time frame only", func(t *testing.T) { testNEP17T(t, 4, 5, 0, 0, []int{21, 22, 23, 24}, []int{4, 5}) }) t.Run("no res", func(t *testing.T) { testNEP17T(t, 100, 100, 0, 0, []int{}, []int{}) }) - t.Run("limit", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 0, []int{17, 18}, []int{2}) }) - t.Run("limit 2", func(t *testing.T) { testNEP17T(t, 4, 5, 2, 0, []int{20}, []int{3}) }) - t.Run("limit with page", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 1, []int{18, 19}, []int{3}) }) - t.Run("limit with page 2", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 2, []int{20, 21}, []int{4}) }) + t.Run("limit", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 0, []int{18, 19}, []int{3}) }) + t.Run("limit 2", func(t *testing.T) { testNEP17T(t, 4, 5, 2, 0, []int{21}, []int{4}) }) + t.Run("limit with page", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 1, []int{19, 20}, []int{4}) }) + t.Run("limit with page 2", func(t *testing.T) { testNEP17T(t, 1, 7, 3, 2, []int{21, 22}, []int{5}) }) }) prepareIteratorSession := func(t *testing.T) (uuid.UUID, uuid.UUID) { @@ -3959,7 +3959,7 @@ func checkNep11TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int } func checkNep17Transfers(t *testing.T, e *executor, acc any) { - checkNep17TransfersAux(t, e, acc, []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}, []int{0, 1, 2, 3, 4, 5, 6, 7, 8}) + checkNep17TransfersAux(t, e, acc, []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}, []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) } func checkNep17TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int) { @@ -4011,9 +4011,18 @@ func checkNep17TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int require.Equal(t, 1, len(blockRegisterDomain.Transactions)) txRegisterDomain := blockRegisterDomain.Transactions[0] + blockAddRoot, err := e.chain.GetBlock(e.chain.GetHeaderHash(14)) // add `.one` root to NNS + require.NoError(t, err) + require.Equal(t, 1, len(blockAddRoot.Transactions)) + txAddRoot := blockAddRoot.Transactions[0] + blockGASBounty2, err := e.chain.GetBlock(e.chain.GetHeaderHash(12)) // size of committee = 6 require.NoError(t, err) + blockGASBounty3 := blockDeploy5 // block 18 is multiple of committee size 6 + + blockGASBounty4 := blockWithFAULTedTx // block 24 is multiple of committee size 6 + blockDeploy4, err := e.chain.GetBlock(e.chain.GetHeaderHash(11)) // deploy ns.go (non-native neo name service contract) require.NoError(t, err) require.Equal(t, 1, len(blockDeploy4.Transactions)) @@ -4174,6 +4183,14 @@ func checkNep17TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int Index: 15, TxHash: blockRegisterDomain.Hash(), }, + { + Timestamp: blockAddRoot.Timestamp, + Asset: e.chain.UtilityTokenHash(), + Address: "", // burn + Amount: big.NewInt(txAddRoot.SystemFee + txAddRoot.NetworkFee).String(), + Index: 14, + TxHash: blockAddRoot.Hash(), + }, { Timestamp: blockDeploy4.Timestamp, Asset: e.chain.UtilityTokenHash(), @@ -4284,13 +4301,22 @@ func checkNep17TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int }, Received: []result.NEP17Transfer{ { - Timestamp: blockMintNFSO.Timestamp, // GAS bounty + Timestamp: blockGASBounty4.Timestamp, // GAS bounty block 24 Asset: e.chain.UtilityTokenHash(), Address: "", Amount: "50000000", - Index: 19, + Index: 24, NotifyIndex: 0, - TxHash: blockMintNFSO.Hash(), + TxHash: blockGASBounty4.Hash(), + }, + { + Timestamp: blockGASBounty3.Timestamp, // GAS bounty block 18 + Asset: e.chain.UtilityTokenHash(), + Address: "", + Amount: "50000000", + Index: 18, + NotifyIndex: 0, + TxHash: blockGASBounty3.Hash(), }, { Timestamp: blockGASBounty2.Timestamp,