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 680c5a7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 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
2 changes: 1 addition & 1 deletion test/contracts/bin/claimmockcaller.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60a03461009357601f6107a538819003918201601f19168301916001600160401b038311848410176100985780849260209460405283398101031261009357516001600160a01b0381168103610093576080526040516106f690816100af823960805181818160dd0152818161037f015281816103f601528181610448015281816104f6015281816105df01526106560152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c90816301beea651461006a575080637a6760ca1461006557806383f5b00614610060578063a51061701461005b5763a8bad36e1461005657600080fd5b61052a565b610477565b610432565b6102bd565b3461010b57610078366101a1565b9b9291505098919897929796939695949599610103575b9060a060809263f5efcd7960e01b8452013561012452013561050452610884526108a4526108c4526108e45261090452610924526109445261096452806020610aac60808360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15080f35b8a995061008f565b80fd5b610864359063ffffffff8216820361012257565b600080fd5b6108a4359063ffffffff8216820361012257565b61088435906001600160a01b038216820361012257565b6108c435906001600160a01b038216820361012257565b9181601f840112156101225782359167ffffffffffffffff8311610122576020838186019501011161012257565b8015150361012257565b906109406003198301126101225761040490828211610122576004926108049281841161012257923591610824359161084435916101dd61010e565b916101e661013b565b916101ef610127565b916101f8610152565b916108e43591610904359067ffffffffffffffff82116101225761021d918d01610169565b90916109243561022c81610197565b90565b9061096060031983011261012257610404908282116101225760049261080492818411610122579235916108243591610844359161026b61010e565b9161027461013b565b9161027d610127565b91610286610152565b916108e435916109043567ffffffffffffffff811161012257816102ab918e01610169565b92909291610964116101225761092490565b346101225760006020610aac6102d23661022f565b9a928c925080949a9150989498979597906102ec8c610692565b61042a575b61030e8f6103076103018461069c565b9761069c565b9d01610692565b610422575b8f918f91938f916080969560a06040519363ccaa2d1160e01b8552013560a48401528787013561048484015261080483015288610824830152896108448301528a6108648301528b6108848301528c6108a48301528d6108c48301526108e48201528360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15060405163ccaa2d1160e01b815260a09b909b013560a48c015201356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8f9b50610313565b8f91506102f1565b34610122576000366003190112610122576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101225760006020610aac61048c366101a1565b9a9291505097919796929695939598610522575b60405163ccaa2d1160e01b815260a09a909a013560a48b0152608001356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8c98506104a0565b346101225760006020610aac61053f3661022f565b9a928c925080949a9150989498979597906105598c610692565b61068a575b61056e8f6103076103018461069c565b610682575b8f918f91938f916080969560a06040519363f5efcd7960e01b8552013560a48401528787013561048484015261080483015288610824830152896108448301528a6108648301528b6108848301528c6108a48301528d6108c48301526108e48201528360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15060405163f5efcd7960e01b815260a09b909b013560a48c015201356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8f9b50610573565b8f915061055e565b3561022c81610197565b90600182018092116106aa57565b634e487b7160e01b600052601160045260246000fdfea26469706673582212206f3769fcc214b0f8c7504e1997edce82f50f2d58d4f184220d12db2f9b490abf64736f6c63430008120033
60a03461009357601f61079738819003918201601f19168301916001600160401b038311848410176100985780849260209460405283398101031261009357516001600160a01b0381168103610093576080526040516106e890816100af823960805181818160dd01528181610375015281816103ec0152818161043e015281816104ec015281816105d101526106480152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c90816301beea651461006a575080637a6760ca1461006557806383f5b00614610060578063a51061701461005b5763a8bad36e1461005657600080fd5b610520565b61046d565b610428565b6102bd565b3461010b57610078366101a1565b9b9291505098919897929796939695949599610103575b9060a060809263f5efcd7960e01b8452013561012452013561050452610884526108a4526108c4526108e45261090452610924526109445261096452806020610aac60808360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15080f35b8a995061008f565b80fd5b610864359063ffffffff8216820361012257565b600080fd5b6108a4359063ffffffff8216820361012257565b61088435906001600160a01b038216820361012257565b6108c435906001600160a01b038216820361012257565b9181601f840112156101225782359167ffffffffffffffff8311610122576020838186019501011161012257565b8015150361012257565b906109406003198301126101225761040490828211610122576004926108049281841161012257923591610824359161084435916101dd61010e565b916101e661013b565b916101ef610127565b916101f8610152565b916108e43591610904359067ffffffffffffffff82116101225761021d918d01610169565b90916109243561022c81610197565b90565b9061096060031983011261012257610404908282116101225760049261080492818411610122579235916108243591610844359161026b61010e565b9161027461013b565b9161027d610127565b91610286610152565b916108e435916109043567ffffffffffffffff811161012257816102ab918e01610169565b92909291610964116101225761092490565b346101225760006020610aac6102d23661022f565b9a939994989597959493928c92509050806102ec8c610684565b610420575b8e6102fe6103059261068e565b9c01610684565b610418575b8d8f91608094938f9160a06040519263ccaa2d1160e01b8452013560a4830152868601356104848301528761080483015288610824830152896108448301528a6108648301528b6108848301528c6108a48301528d6108c48301526108e48201528360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15060405163ccaa2d1160e01b815260a09b909b013560a48c015201356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8e9a5061030a565b8f91506102f1565b34610122576000366003190112610122576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101225760006020610aac610482366101a1565b9a9291505097919796929695939598610518575b60405163ccaa2d1160e01b815260a09a909a013560a48b0152608001356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8c9850610496565b346101225760006020610aac6105353661022f565b9a939994989597959493928c925090508061054f8c610684565b61067c575b8e6102fe6105619261068e565b610674575b8d8f91608094938f9160a06040519263f5efcd7960e01b8452013560a4830152868601356104848301528761080483015288610824830152896108448301528a6108648301528b6108848301528c6108a48301528d6108c48301526108e48201528360018060a01b037f0000000000000000000000000000000000000000000000000000000000000000165af15060405163f5efcd7960e01b815260a09b909b013560a48c015201356104848a01526108048901526108248801526108448701526108648601526108848501526108a48401526108c48301526108e4820152837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1005b8e9a50610566565b8f9150610554565b3561022c81610197565b906001820180921161069c57565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c04c7f39b262e6c0fcd8ddd51e2d50fb9d6b33d0b11bd2015734dffd6d60383364736f6c63430008120033
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
Loading

0 comments on commit 680c5a7

Please sign in to comment.