Skip to content
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 getEthResources #261

Merged
merged 1 commit into from
Feb 11, 2022
Merged

add getEthResources #261

merged 1 commit into from
Feb 11, 2022

Conversation

ntduan
Copy link
Collaborator

@ntduan ntduan commented Feb 1, 2022

No description provided.

* @returns The gas used by eth transaction
*/
getEthResources = async (
transaction: Deferrable<TransactionRequest>,
Copy link
Collaborator

@shunjizhan shunjizhan Feb 7, 2022

Choose a reason for hiding this comment

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

we can make transaction param optional, so then we will be able to use this method directly to calculate eth gasLimit/gasPrice when we don't know the whole transaction

Copy link
Collaborator

@shunjizhan shunjizhan Feb 7, 2022

Choose a reason for hiding this comment

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

something like

## when don't know whole TX
const ethGasParams = getEthResources({
  transactions: null,
  gasLimit,
  validUntil,
  storageLimit,
})

## when know whole TX
const ethGasParams = getEthResources({
  transactions: null
})

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This api is copied from estimateGas and requires transaction parameters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If the transaction parameter is not known, then a function can be designed separately.

@ntduan ntduan merged commit 7f0965c into master Feb 11, 2022
@ntduan ntduan deleted the add-getEthResources branch February 11, 2022 02:24
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.

None yet

2 participants