Skip to content

Commit

Permalink
fix test claimcalldata
Browse files Browse the repository at this point in the history
  • Loading branch information
laisolizq committed Sep 5, 2024
1 parent cc20697 commit 1761f04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 9 additions & 9 deletions bridgesync/claimcalldata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func TestClaimCalldata(t *testing.T) {
expectedClaim.IsMessage = true
expectedClaim.GlobalIndex = big.NewInt(425)
expectedClaim2.IsMessage = true
expectedClaim2.GlobalIndex = big.NewInt(426)
expectedClaim2.GlobalIndex = big.NewInt(425)
tx, err = claimCaller.ClaimMessage2(
auth,
proofLocal,
Expand Down Expand Up @@ -235,7 +235,7 @@ func TestClaimCalldata(t *testing.T) {

// 2 indirect call claim message (1 ok, 1 reverted)
expectedClaim.IsMessage = true
expectedClaim.GlobalIndex = big.NewInt(427)
expectedClaim.GlobalIndex = big.NewInt(426)
tx, err = claimCaller.ClaimMessage2(
auth,
proofLocal,
Expand Down Expand Up @@ -265,8 +265,8 @@ func TestClaimCalldata(t *testing.T) {

// 2 indirect call claim message (1 reverted, 1 ok)
expectedClaim2.IsMessage = true
expectedClaim.GlobalIndex = big.NewInt(429)
expectedClaim2.GlobalIndex = big.NewInt(430)
expectedClaim.GlobalIndex = big.NewInt(427)
expectedClaim2.GlobalIndex = big.NewInt(427)
tx, err = claimCaller.ClaimMessage2(
auth,
proofLocal,
Expand Down Expand Up @@ -296,9 +296,9 @@ func TestClaimCalldata(t *testing.T) {

// 2 indirect call claim asset
expectedClaim.IsMessage = false
expectedClaim.GlobalIndex = big.NewInt(431)
expectedClaim.GlobalIndex = big.NewInt(428)
expectedClaim2.IsMessage = false
expectedClaim2.GlobalIndex = big.NewInt(432)
expectedClaim2.GlobalIndex = big.NewInt(428)
tx, err = claimCaller.ClaimAsset2(
auth,
proofLocal,
Expand Down Expand Up @@ -335,7 +335,7 @@ func TestClaimCalldata(t *testing.T) {

// 2 indirect call claim asset (1 ok, 1 reverted)
expectedClaim.IsMessage = false
expectedClaim.GlobalIndex = big.NewInt(433)
expectedClaim.GlobalIndex = big.NewInt(429)
tx, err = claimCaller.ClaimAsset2(
auth,
proofLocal,
Expand Down Expand Up @@ -367,8 +367,8 @@ func TestClaimCalldata(t *testing.T) {

// 2 indirect call claim asset (1 reverted, 1 ok)
expectedClaim2.IsMessage = false
expectedClaim.GlobalIndex = big.NewInt(435)
expectedClaim2.GlobalIndex = big.NewInt(436)
expectedClaim.GlobalIndex = big.NewInt(430)
expectedClaim2.GlobalIndex = big.NewInt(430)
tx, err = claimCaller.ClaimAsset2(
auth,
proofLocal,
Expand Down
6 changes: 2 additions & 4 deletions test/contracts/claimmockcaller/ClaimMockCaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ contract ClaimMockCaller {
if(reverted[0]) {
newAmount1 = 0;
}
uint256 globalIndex2 = globalIndex + 1;
uint256 newAmount2 = amount+1;
if(reverted[1]) {
newAmount2 = 0;
Expand Down Expand Up @@ -104,7 +103,7 @@ contract ClaimMockCaller {
mstore(x,argSig)
mstore(add(x,164),value1)
mstore(add(x,1156),value2)
mstore(add(x,2052),globalIndex2)
mstore(add(x,2052),globalIndex)
mstore(add(x,2084),mainnetExitRoot)
mstore(add(x,2116),rollupExitRoot)
mstore(add(x,2148),originNetwork)
Expand Down Expand Up @@ -174,7 +173,6 @@ contract ClaimMockCaller {
if(reverted[0]) {
newAmount1 = 0;
}
uint256 globalIndex2 = globalIndex + 1;
uint256 newAmount2 = amount+1;
if(reverted[1]) {
newAmount2 = 0;
Expand Down Expand Up @@ -202,7 +200,7 @@ contract ClaimMockCaller {
mstore(x,argSig)
mstore(add(x,164),value1)
mstore(add(x,1156),value2)
mstore(add(x,2052),globalIndex2)
mstore(add(x,2052),globalIndex)
mstore(add(x,2084),mainnetExitRoot)
mstore(add(x,2116),rollupExitRoot)
mstore(add(x,2148),originNetwork)
Expand Down

0 comments on commit 1761f04

Please sign in to comment.