Add block 14 and GAS bounty entries to server_test.go

Update test expectations for .one TLD block addition at index 14:

Block Definitions:
- Add blockAddRoot and txAddRoot for block 14 (add .one root to NNS)
- Add blockGASBounty3 (block 18) and blockGASBounty4 (block 24)

Sent Array:
- Add entry for block 14 addRoot transaction fees
- Total Sent entries: 26 (was 25)

Received Array:
- Add GAS bounty entries for blocks 18 and 24
- Total Received entries: 9 (was 8)

Index Updates:
- Sent indices in limit tests: shifted by +1 for indices >= 12
- Received indices in limit tests: shifted by +1 for indices >= 1
- checkNep17Transfers: updated to include all 26 sent and 9 received

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tutus Development 2025-12-22 12:41:18 -05:00
parent ba3e028587
commit 13bfe827ae
1 changed files with 35 additions and 9 deletions

View File

@ -3100,12 +3100,12 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) []
require.NoError(t, json.Unmarshal(res, actual)) require.NoError(t, json.Unmarshal(res, actual))
checkNep17TransfersAux(t, e, actual, sent, rcvd) 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("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", 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{20}, []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{18, 19}, []int{3}) }) 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{20, 21}, []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) { 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) { 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) { 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)) require.Equal(t, 1, len(blockRegisterDomain.Transactions))
txRegisterDomain := blockRegisterDomain.Transactions[0] 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 blockGASBounty2, err := e.chain.GetBlock(e.chain.GetHeaderHash(12)) // size of committee = 6
require.NoError(t, err) 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) blockDeploy4, err := e.chain.GetBlock(e.chain.GetHeaderHash(11)) // deploy ns.go (non-native neo name service contract)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 1, len(blockDeploy4.Transactions)) 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, Index: 15,
TxHash: blockRegisterDomain.Hash(), 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, Timestamp: blockDeploy4.Timestamp,
Asset: e.chain.UtilityTokenHash(), Asset: e.chain.UtilityTokenHash(),
@ -4284,13 +4301,22 @@ func checkNep17TransfersAux(t *testing.T, e *executor, acc any, sent, rcvd []int
}, },
Received: []result.NEP17Transfer{ Received: []result.NEP17Transfer{
{ {
Timestamp: blockMintNFSO.Timestamp, // GAS bounty Timestamp: blockGASBounty4.Timestamp, // GAS bounty block 24
Asset: e.chain.UtilityTokenHash(), Asset: e.chain.UtilityTokenHash(),
Address: "", Address: "",
Amount: "50000000", Amount: "50000000",
Index: 19, Index: 24,
NotifyIndex: 0, 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, Timestamp: blockGASBounty2.Timestamp,