Add checks to TxSelector & other:

- Upgrade go-merkletree version to include the last changes of Pebble
that fixes the cgo issues (which should fix #453), from:
c2b05f12d7
- TxSelector
	- Remove parameter batchNum for GetL2TxSelection & GetL1L2TxSelection
	- Add checks of ToBJJ & ToEthAddr when ToIdx>255
	- Avoid getting the sender account twice to get the TokenID of a l2tx
	- Add test to check that selected L2Txs are sorted by Nonce
	- Discard L2Tx that return error at ProcessL2Txs
- executed `go mod tidy`
This commit is contained in:
arnaucube
2021-01-05 15:19:31 +01:00
parent 6fa4a2e799
commit 962b9e4712
8 changed files with 208 additions and 71 deletions

View File

@@ -64,7 +64,7 @@ func NewKVDB(pathDB string, keep int) (*KVDB, error) {
}
// make reset (get checkpoint) at currentBatch
err = kvdb.reset(kvdb.CurrentBatch, false)
err = kvdb.reset(kvdb.CurrentBatch, true)
if err != nil {
return nil, tracerr.Wrap(err)
}

View File

@@ -38,7 +38,7 @@ func TestCheckpoints(t *testing.T) {
defer assert.NoError(t, os.RemoveAll(dir))
db, err := NewKVDB(dir, 128)
assert.NoError(t, err)
require.NoError(t, err)
// add test key-values
for i := 0; i < 10; i++ {