mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-08 03:46:52 +01:00
Update TxSelector to return CoordIdxs used & other
- StateDB - Update GetIdxByEthAddrBJJ to return ErrToIdxNotFound when idx not found, so can be checked at upper levels - TxSelector - rm CoordIdxsDB that is no longer needed (also related methods) - add `getCoordIdx` method to get the Coordinator Idx for a given TokenID - Update coordinator account creation related to new TokenIDs from L2Txs - Reorganize GetL1L2TxSelection - return CoordIdxs used in the selection - Update go-merkletree version which avoids marshaling Siblings to json with 'null' value in case of empty array
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package statedb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -83,8 +82,7 @@ func TestGetIdx(t *testing.T) {
|
||||
// expect error when trying to get Idx by addr2 & pk2
|
||||
idxR, err = sdb.GetIdxByEthAddrBJJ(addr2, pk2.Compress(), tokenID0)
|
||||
assert.NotNil(t, err)
|
||||
expectedErr := fmt.Errorf("GetIdxByEthAddrBJJ: %s: ToEthAddr: %s, ToBJJ: %s, TokenID: %d", ErrToIdxNotFound, addr2.Hex(), pk2, tokenID0)
|
||||
assert.Equal(t, expectedErr, tracerr.Unwrap(err))
|
||||
assert.Equal(t, ErrIdxNotFound, tracerr.Unwrap(err))
|
||||
assert.Equal(t, common.Idx(0), idxR)
|
||||
// expect error when trying to get Idx by addr with not used TokenID
|
||||
_, err = sdb.GetIdxByEthAddr(addr, tokenID1)
|
||||
|
||||
Reference in New Issue
Block a user