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

Feat: option to add fee payer account #1159

Closed
wants to merge 7 commits into from

Conversation

arnabghose997
Copy link
Contributor

This PR involves allowing users to set an account as FeePayer, as it is needed for the transaction type /osmos.authz.v1beta1.MsgExec to execute.

Reference Issue: #1155

@arnabghose997 arnabghose997 marked this pull request as ready for review June 2, 2022 11:07
@arnabghose997 arnabghose997 marked this pull request as draft June 2, 2022 11:09
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Nice start. I think there is some confision with payer vs. granter. Please consult the Cosmos SDK team if you have questions what the difference is. I never used this tech.

packages/proto-signing/src/signing.ts Outdated Show resolved Hide resolved
packages/proto-signing/src/signing.ts Outdated Show resolved Hide resolved
@webmaster128 webmaster128 mentioned this pull request Jun 8, 2022
7 tasks
@webmaster128 webmaster128 added this to the 0.29.0 milestone Jun 8, 2022
@arnabghose997 arnabghose997 marked this pull request as ready for review June 15, 2022 13:04
@arnabghose997
Copy link
Contributor Author

payer and granter fields are added as part of StdFee interface.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Looks good overall, thanks.

Do you have an idea how to test the new code?

packages/cosmwasm-stargate/src/testutils.spec.ts Outdated Show resolved Hide resolved
packages/cosmwasm-stargate/src/signingcosmwasmclient.ts Outdated Show resolved Hide resolved
packages/cosmwasm-stargate/src/signingcosmwasmclient.ts Outdated Show resolved Hide resolved
packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts Outdated Show resolved Hide resolved
packages/stargate/src/signingstargateclient.ts Outdated Show resolved Hide resolved
packages/stargate/src/stargateclient.searchtx.spec.ts Outdated Show resolved Hide resolved
packages/stargate/src/stargateclient.spec.ts Outdated Show resolved Hide resolved
packages/stargate/src/stargateclient.spec.ts Outdated Show resolved Hide resolved
packages/stargate/src/testutils.spec.ts Outdated Show resolved Hide resolved
@arnabghose997
Copy link
Contributor Author

The sequence of transactions for a complete authz+feegrant are as follows:

  1. /cosmos.authz.v1beta1.MsgGrant
  2. /cosmos.feegrant.v1beta1.MsgGrantAllowance
  3. /cosmos.authz.v1beta1.MsgExec

The test should execute the above messages sequentially. We can consider packages/stargate/src/modules/authz/queries.spec.ts as a reference.

Before proceeding with writing this test, I have a query. As mentioned in HACKING.md, we need to run few scripts and set flags to perform complete test suite run. In the current version of HACKING.md present on main branch, there is mention of running launchpad blockchain, although its corresponding scripts aren't present in the main branch. So, I wanted to know about the scipts we need to run and the flags that needs to set instead of launchpad?

@webmaster128
Copy link
Member

Sounds good, thank you.

In #1206 I fixed the outdated docs. Let me know if there are any questions left.

@dckc
Copy link

dckc commented Jul 22, 2022

Anything I can do to help this along?

@webmaster128
Copy link
Member

Anything I can do to help this along?

Thank you @dckc. I am hesitant to merge this without the feature being tested. I don't want this feature to fail in the user's environment. Also having a test case serves as an always up-to-date example how to use the feature. Writing tests may detect flaws in the API. If you could add tests on top of that PR, I think we can get this out.

Please note that on latest main we have Cosmos SDK 0.44 and 0.46 (simapp44/simapp46) test chains. simapp42 was removed. With those chains it should be possible to test the whole flow.

@webmaster128
Copy link
Member

I'm finishing this work in #1262. The test is in c959343. Turns out no /cosmos.authz.v1beta1.MsgGrant and /cosmos.authz.v1beta1.MsgExec is needed to test that as you can use feegrant for a simple bank send.

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