Skip to content

refactor: send tokens to L2 #687

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

Closed
wants to merge 2 commits into from
Closed

Conversation

abarmat
Copy link
Contributor

@abarmat abarmat commented Aug 19, 2022

Changes

  • Move estimate gas for L2 ticket to a function for reuse
  • Move some functions to it's own cross-chain library
  • Convert gas params inputs into BigNumber
  • Ensure allowance and skip if already done

@abarmat abarmat force-pushed the ariel/cli-send-l2-refactor branch from 722b88b to abe546a Compare August 19, 2022 15:44
@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Merging #687 (9c33fd7) into l2-testnet (82b26e4) will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           l2-testnet     #687   +/-   ##
===========================================
  Coverage       92.13%   92.13%           
===========================================
  Files              44       44           
  Lines            2137     2137           
  Branches          370      370           
===========================================
  Hits             1969     1969           
  Misses            168      168           
Flag Coverage Δ
unittests 92.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

const txReceipt = await sendTransaction(cli.wallet, l1Gateway, 'outboundTransfer', txParams)

// get l2 ticket status
if (txReceipt.status == 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fail more noisily if txReceipt.status is not 1?

depositCalldata: string,
opts: L2GasParams,
): Promise<L2GasParams> => {
const autoEstimate = opts && (!opts.maxGas || !opts.gasPriceBid || !opts.maxSubmissionCost)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the opts && needed here? I think typescript won't allow it to be null anyways (unless you mark it as optional in the function definition), but in any case if opts is nullish we would want to auto-estimate, wouldn't we?

@pcarranzav pcarranzav mentioned this pull request Sep 8, 2022
2 tasks
@tmigone
Copy link
Member

tmigone commented Sep 9, 2022

Changes cherry picked onto #704

@tmigone tmigone closed this Sep 9, 2022
@abarmat abarmat deleted the ariel/cli-send-l2-refactor branch December 21, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants