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

Autogenerated CosmJS Interface hardcodes gas #147

Open
patrickwieth opened this issue Dec 7, 2021 · 0 comments
Open

Autogenerated CosmJS Interface hardcodes gas #147

patrickwieth opened this issue Dec 7, 2021 · 0 comments
Assignees
Labels
closed-after-ts-client Already solved by SDK but not published yet.
Projects

Comments

@patrickwieth
Copy link

patrickwieth commented Dec 7, 2021

The error i get is:
index.js:883 Uncaught (in promise) TxClient:MsgSetItemString:Send: Could not broadcast Tx: Broadcasting transaction failed with code 13 (codespace: sdk). Log: invalid fee provided: null: insufficient fee

This is because the gas fee is too low for the transaction I wanted to do. The used code was generated with starport g vuex. It is actually done with the Pylons blockchain, but I think this does not matter.

image

The screenshot shows the function and I could fix my error by increasing the hardcoded gas fees. I think the proper way would be that the gas fee limits can be piped through in a dispatch like this:
.dispatch('Pylonstech.pylons.pylons/sendMsgSetItemString', { value: { '@type': '/Pylonstech.pylons.pylons.MsgSetItemString', creator: this.$store.getters['common/wallet/address'], cookbookID: 'nftarena', ID: this.heroNft.ID, field: 'image', value: compressedImg, }, fee: [ { amount: [], gas_limit: 2000000, payer: "", granter: "" } ] })
the same code but with readability:

image

the fee cannot be set in a dispatched tx, because it is hardcoded

@marinhoarthur marinhoarthur added the enhancement Improvement over existing feature label Dec 7, 2021
@marinhoarthur marinhoarthur self-assigned this Dec 15, 2021
@fadeev fadeev added this to To Do in Board Feb 23, 2022
@marinhoarthur marinhoarthur added closed-after-ts-client Already solved by SDK but not published yet. and removed enhancement Improvement over existing feature labels Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-after-ts-client Already solved by SDK but not published yet.
Projects
Board
  
To Do
Development

No branches or pull requests

2 participants