mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Test purger, fix some nonces
- Test all the purger functions - Fix nonces set by til (previously til started with nonce 1 for pool l2txs, but the correct implementation is to start with nonce 0) - Rename L2DB.CheckNonces to L2DB.invalidateOldNoncesQuery - Rename L2DB.checkNoncesQuery to L2DB.InvalidateOldNonces Related https://github.com/hermeznetwork/hermez-node/issues/392 (Fix checkNoncesQuery) Resolve https://github.com/hermeznetwork/hermez-node/issues/396
This commit is contained in:
@@ -218,9 +218,9 @@ func TestGeneratePoolL2Txs(t *testing.T) {
|
||||
assert.Equal(t, tc.Users["User1"].Addr.Hex(), poolL2Txs[5].ToEthAddr.Hex())
|
||||
assert.Equal(t, tc.Users["User1"].BJJ.Public().String(), poolL2Txs[5].ToBJJ.String())
|
||||
|
||||
assert.Equal(t, common.Nonce(1), poolL2Txs[0].Nonce)
|
||||
assert.Equal(t, common.Nonce(2), poolL2Txs[3].Nonce)
|
||||
assert.Equal(t, common.Nonce(3), poolL2Txs[8].Nonce)
|
||||
assert.Equal(t, common.Nonce(0), poolL2Txs[0].Nonce)
|
||||
assert.Equal(t, common.Nonce(1), poolL2Txs[3].Nonce)
|
||||
assert.Equal(t, common.Nonce(2), poolL2Txs[8].Nonce)
|
||||
|
||||
assert.Equal(t, tc.Users["B"].Addr.Hex(), poolL2Txs[9].ToEthAddr.Hex())
|
||||
assert.Equal(t, common.EmptyBJJComp, poolL2Txs[9].ToBJJ)
|
||||
@@ -238,9 +238,9 @@ func TestGeneratePoolL2Txs(t *testing.T) {
|
||||
`
|
||||
poolL2Txs, err = tc.GeneratePoolL2Txs(set)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, common.Nonce(6), poolL2Txs[0].Nonce)
|
||||
assert.Equal(t, common.Nonce(2), poolL2Txs[1].Nonce)
|
||||
assert.Equal(t, common.Nonce(7), poolL2Txs[2].Nonce)
|
||||
assert.Equal(t, common.Nonce(5), poolL2Txs[0].Nonce)
|
||||
assert.Equal(t, common.Nonce(1), poolL2Txs[1].Nonce)
|
||||
assert.Equal(t, common.Nonce(6), poolL2Txs[2].Nonce)
|
||||
|
||||
// check that a PoolL2Tx can be done to a non existing ToIdx
|
||||
set = `
|
||||
|
||||
Reference in New Issue
Block a user