Add transakcio set type define, add set load [...]

Add transakcio set type definition, add set loading, move transakcio to
package, adapt branch to last master updates (fix compile due new common
types & git conflicts).
Update tests to pass the test, pending to adapt to new Transakcio
interface.
This commit is contained in:
arnaucube
2020-10-09 14:06:51 +02:00
parent b40bccfc00
commit 431df55120
24 changed files with 1429 additions and 1365 deletions

View File

@@ -253,9 +253,9 @@ type RollupForgeBatchArgs struct {
NewLastIdx int64
NewStRoot *big.Int
NewExitRoot *big.Int
L1CoordinatorTxs []*common.L1Tx
L1CoordinatorTxs []common.L1Tx
L1CoordinatorTxsAuths [][]byte // Authorization for accountCreations for each L1CoordinatorTx
L2TxsData []*common.L2Tx
L2TxsData []common.L2Tx
FeeIdxCoordinator []common.Idx
// Circuit selector
VerifierIdx uint8
@@ -698,7 +698,7 @@ func (c *RollupClient) RollupForgeBatchArgs(ethTxHash ethCommon.Hash) (*RollupFo
if err != nil {
return nil, err
}
rollupForgeBatchArgs.L1CoordinatorTxs = append(rollupForgeBatchArgs.L1CoordinatorTxs, l1Tx)
rollupForgeBatchArgs.L1CoordinatorTxs = append(rollupForgeBatchArgs.L1CoordinatorTxs, *l1Tx)
rollupForgeBatchArgs.L1CoordinatorTxsAuths = append(rollupForgeBatchArgs.L1CoordinatorTxsAuths, signature)
}
rollupConsts, err := c.RollupConstants()
@@ -713,7 +713,7 @@ func (c *RollupClient) RollupForgeBatchArgs(ethTxHash ethCommon.Hash) (*RollupFo
if err != nil {
return nil, err
}
rollupForgeBatchArgs.L2TxsData = append(rollupForgeBatchArgs.L2TxsData, l2Tx)
rollupForgeBatchArgs.L2TxsData = append(rollupForgeBatchArgs.L2TxsData, *l2Tx)
}
lenFeeIdxCoordinatorBytes := int(nLevels / 8) //nolint:gomnd
numFeeIdxCoordinator := len(aux.FeeIdxCoordinator) / lenFeeIdxCoordinatorBytes

View File

@@ -97,7 +97,7 @@ func TestRollupForgeBatch(t *testing.T) {
signature = append(signature, v)
L1Tx, err := common.L1TxFromCoordinatorBytes(bytesL1Coordinator)
require.Nil(t, err)
args.L1CoordinatorTxs = append(args.L1CoordinatorTxs, L1Tx)
args.L1CoordinatorTxs = append(args.L1CoordinatorTxs, *L1Tx)
args.L1CoordinatorTxsAuths = append(args.L1CoordinatorTxsAuths, signature)
}
newStateRoot := new(big.Int)