@ -78,8 +78,10 @@ func TestRollupAddToken(t *testing.T) {
require . Nil ( t , err )
_ , err = rollupClient . RollupAddToken ( tokenHEZAddressConst , feeAddToken , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , tokenHEZAddressConst , rollupEvents . AddToken [ 0 ] . TokenAddress )
assert . Equal ( t , registerTokensCount , common . TokenID ( rollupEvents . AddToken [ 0 ] . TokenID ) . BigInt ( ) )
@ -108,7 +110,8 @@ func TestRollupForgeBatch(t *testing.T) {
// Add Blocks
blockNum := int64 ( int ( blocksPerSlot ) * int ( currentSlot + 4 ) + int ( genesisBlock ) )
currentBlockNum , _ := auctionClient . client . EthCurrentBlock ( )
currentBlockNum , err := auctionClient . client . EthLastBlock ( )
require . Nil ( t , err )
blocksToAdd := blockNum - currentBlockNum
addBlocks ( blocksToAdd , ethClientDialURL )
@ -157,8 +160,10 @@ func TestRollupForgeBatch(t *testing.T) {
_ , err = rollupClient . RollupForgeBatch ( argsForge )
require . Nil ( t , err )
currentBlockNum , _ = rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err = rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , int64 ( 1 ) , rollupEvents . ForgeBatch [ 0 ] . BatchNum )
ethHashForge = rollupEvents . ForgeBatch [ 0 ] . EthTxHash
@ -183,8 +188,10 @@ func TestRollupUpdateForgeL1L2BatchTimeout(t *testing.T) {
_ , err := rollupClient . RollupUpdateForgeL1L2BatchTimeout ( newForgeL1L2BatchTimeout )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , newForgeL1L2BatchTimeout , rollupEvents . UpdateForgeL1L2BatchTimeout [ 0 ] . NewForgeL1L2BatchTimeout )
}
@ -194,8 +201,10 @@ func TestRollupUpdateFeeAddToken(t *testing.T) {
_ , err := rollupClient . RollupUpdateFeeAddToken ( newFeeAddToken )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , newFeeAddToken , rollupEvents . UpdateFeeAddToken [ 0 ] . NewFeeAddToken )
}
@ -219,8 +228,10 @@ func TestRollupL1UserTxETHCreateAccountDeposit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -247,8 +258,10 @@ func TestRollupL1UserTxERC20CreateAccountDeposit(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -275,8 +288,10 @@ func TestRollupL1UserTxERC20PermitCreateAccountDeposit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -304,8 +319,10 @@ func TestRollupL1UserTxETHDeposit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -332,8 +349,10 @@ func TestRollupL1UserTxERC20Deposit(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -360,8 +379,10 @@ func TestRollupL1UserTxERC20PermitDeposit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -389,8 +410,10 @@ func TestRollupL1UserTxETHDepositTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -417,8 +440,10 @@ func TestRollupL1UserTxERC20DepositTransfer(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -445,8 +470,10 @@ func TestRollupL1UserTxERC20PermitDepositTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -474,8 +501,10 @@ func TestRollupL1UserTxETHCreateAccountDepositTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -502,8 +531,10 @@ func TestRollupL1UserTxERC20CreateAccountDepositTransfer(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -530,8 +561,10 @@ func TestRollupL1UserTxERC20PermitCreateAccountDepositTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -559,8 +592,10 @@ func TestRollupL1UserTxETHForceTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -587,8 +622,10 @@ func TestRollupL1UserTxERC20ForceTransfer(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -615,8 +652,10 @@ func TestRollupL1UserTxERC20PermitForceTransfer(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -644,8 +683,10 @@ func TestRollupL1UserTxETHForceExit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDUint32 , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -672,8 +713,10 @@ func TestRollupL1UserTxERC20ForceExit(t *testing.T) {
_ , err = rollupClientAux2 . RollupL1UserTxERC20ETH ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenHEZID , toIdxInt64 )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -702,8 +745,10 @@ func TestRollupL1UserTxERC20PermitForceExit(t *testing.T) {
_ , err = rollupClientAux . RollupL1UserTxERC20Permit ( l1Tx . FromBJJ , fromIdxInt64 , l1Tx . LoadAmount , l1Tx . Amount , tokenIDERC777 , toIdxInt64 , deadline )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , l1Tx . FromBJJ , rollupEvents . L1UserTx [ 0 ] . L1UserTx . FromBJJ )
assert . Equal ( t , l1Tx . ToIdx , rollupEvents . L1UserTx [ 0 ] . L1UserTx . ToIdx )
assert . Equal ( t , l1Tx . LoadAmount , rollupEvents . L1UserTx [ 0 ] . L1UserTx . LoadAmount )
@ -750,8 +795,10 @@ func TestRollupForgeBatch2(t *testing.T) {
_ , err = rollupClient . RollupForgeBatch ( argsForge )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , int64 ( 2 ) , rollupEvents . ForgeBatch [ 0 ] . BatchNum )
ethHashForge = rollupEvents . ForgeBatch [ 0 ] . EthTxHash
@ -777,9 +824,9 @@ func TestRollupWithdrawMerkleProof(t *testing.T) {
numExitRoot := int64 ( 2 )
fromIdx := int64 ( 256 )
amount := big . NewInt ( 10 )
// siblingBytes0, _ := new(big.Int).SetString("19508838618377323910556678335932426220272947530531646682154552299216398748115", 10)
// siblingBytes0, err := new(big.Int).SetString("19508838618377323910556678335932426220272947530531646682154552299216398748115", 10)
// require.Nil(t, err)
// siblingBytes1, _ := new(big.Int).SetString("15198806719713909654457742294233381653226080862567104272457668857208564789571", 10)
// siblingBytes1, err := new(big.Int).SetString("15198806719713909654457742294233381653226080862567104272457668857208564789571", 10)
// require.Nil(t, err)
var siblings [ ] * big . Int
// siblings = append(siblings, siblingBytes0)
@ -789,8 +836,10 @@ func TestRollupWithdrawMerkleProof(t *testing.T) {
_ , err = rollupClientAux . RollupWithdrawMerkleProof ( pk , tokenID , numExitRoot , fromIdx , amount , siblings , instantWithdraw )
require . Nil ( t , err )
currentBlockNum , _ := rollupClient . client . EthCurrentBlock ( )
rollupEvents , _ , _ := rollupClient . RollupEventsByBlock ( currentBlockNum )
currentBlockNum , err := rollupClient . client . EthLastBlock ( )
require . Nil ( t , err )
rollupEvents , _ , err := rollupClient . RollupEventsByBlock ( currentBlockNum )
require . Nil ( t , err )
assert . Equal ( t , uint64 ( fromIdx ) , rollupEvents . Withdraw [ 0 ] . Idx )
assert . Equal ( t , instantWithdraw , rollupEvents . Withdraw [ 0 ] . InstantWithdraw )