-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add retryable expiry system tests #2799
Open
magicxyyz
wants to merge
1
commit into
master
Choose a base branch
from
retryable-expiry-test
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cla-bot
bot
added
the
s
Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
label
Nov 19, 2024
diegoximenes
requested changes
Nov 21, 2024
Comment on lines
+475
to
+522
builder, delayedInbox, lookupL2Tx, ctx, teardown := retryableSetup(t) | ||
defer teardown() | ||
|
||
ownerTxOpts := builder.L2Info.GetDefaultTransactOpts("Owner", ctx) | ||
usertxopts := builder.L1Info.GetDefaultTransactOpts("Faucet", ctx) | ||
usertxopts.Value = arbmath.BigMul(big.NewInt(1e12), big.NewInt(1e12)) | ||
|
||
simpleAddr, _ := builder.L2.DeploySimple(t, ownerTxOpts) | ||
simpleABI, err := mocksgen.SimpleMetaData.GetAbi() | ||
Require(t, err) | ||
|
||
beneficiaryAddress := builder.L2Info.GetAddress("Beneficiary") | ||
l1tx, err := delayedInbox.CreateRetryableTicket( | ||
&usertxopts, | ||
simpleAddr, | ||
common.Big0, | ||
big.NewInt(1e16), | ||
beneficiaryAddress, | ||
beneficiaryAddress, | ||
// send enough L2 gas for intrinsic but not compute | ||
big.NewInt(int64(params.TxGas+params.TxDataNonZeroGasEIP2028*4)), | ||
big.NewInt(l2pricing.InitialBaseFeeWei*2), | ||
simpleABI.Methods["incrementRedeem"].ID, | ||
) | ||
Require(t, err) | ||
|
||
l1Receipt, err := builder.L1.EnsureTxSucceeded(l1tx) | ||
Require(t, err) | ||
if l1Receipt.Status != types.ReceiptStatusSuccessful { | ||
Fatal(t, "l1Receipt indicated failure") | ||
} | ||
|
||
waitForL1DelayBlocks(t, builder) | ||
|
||
receipt, err := builder.L2.EnsureTxSucceeded(lookupL2Tx(l1Receipt)) | ||
Require(t, err) | ||
if len(receipt.Logs) != 2 { | ||
Fatal(t, len(receipt.Logs)) | ||
} | ||
ticketId := receipt.Logs[0].Topics[1] | ||
firstRetryTxId := receipt.Logs[1].Topics[2] | ||
|
||
// make sure it failed | ||
receipt, err = WaitForTx(ctx, builder.L2.Client, firstRetryTxId, time.Second*5) | ||
Require(t, err) | ||
if receipt.Status != types.ReceiptStatusFailed { | ||
Fatal(t, receipt.GasUsed) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behavior is being implemented several times already in this file, how about having another setup function to abstract that and avoid code repetition?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
s
Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves NIT-2874