-
Notifications
You must be signed in to change notification settings - Fork 220
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
SPIKE: signing wallet actions with keplr, ledger #5761
Conversation
- allow caller to pass authority explicitly
- ISSUE: started with cosmjs API integration but couldn't get it to work without skipping it
no longer skipping all the way to keplr.signAmino()
- refactor keplr access
- can connect to chain and query for sequence - aminoTypes seem to work - TODO: generate protobuf codec for MsgWalletAction
- build:proto using ts-proto seems to be working - TODO: tsc is griping about conflicts between jest and mocha. Why is it looking at jest and mocha???
built in Agoric/faucet (cosmjs-rpc branch) and copied over
avoid: Error: Broadcasting transaction failed with code 11 (codespace: sdk). Log: out of gas in location: ReadFlat; gasWanted: 250, gasUsed: 1000: out of gas at SigningStargateClient.broadcastTx (stargateclient.ts:413:9) at async HTMLButtonElement.<anonymous> (keplr-ledger-demo.js:215:16)
ok... I think I got a
This looks like a "something bad happened; good luck finding it" diagnostic. I don't see anything in the p.s. I thought maybe the problem was the missing amino codec registration, but even after fixing that (0930864), symptoms persist. |
authz working (Any encoding)
|
example result: agoric-sdk/packages/cosmic-swingset$ ~/go/bin/agd query tx E0EDE9B200AB0B9FF33DA288BC9E455C228854D76D5AD12C80EA5138C6706D06 ... timestamp: "2022-07-20T03:07:21Z" tx: '@type': /cosmos.tx.v1beta1.Tx auth_info: fee: amount: - amount: "0" denom: uist gas_limit: "100000" granter: "" payer: "" signer_infos: - mode_info: single: mode: SIGN_MODE_DIRECT public_key: '@type': /cosmos.crypto.secp256k1.PubKey key: AggWzZHxF8d7Quy/N9UUGWwU05pIEJKNFGFPpfx01Ika sequence: "4" body: extension_options: [] memo: "" messages: - '@type': /cosmos.authz.v1beta1.MsgGrant grant: authorization: '@type': /cosmos.authz.v1beta1.GenericAuthorization msg: /agoric.swingset.MsgWalletAction expiration: "2022-07-20T07:07:22Z" grantee: agoric12ufmm960ynt0svr8c7gwy9he909z34w73fkue8 granter: agoric1uh4ynz9h3ea9vc80tl30s4ykmcyqwfl0d7zelw - '@type': /cosmos.feegrant.v1beta1.MsgGrantAllowance allowance: '@type': /cosmos.feegrant.v1beta1.BasicAllowance expiration: "2022-07-20T07:07:22Z" spend_limit: - amount: "250000" denom: uist grantee: agoric12ufmm960ynt0svr8c7gwy9he909z34w73fkue8 granter: agoric1uh4ynz9h3ea9vc80tl30s4ykmcyqwfl0d7zelw non_critical_extension_options: [] timeout_height: "0" signatures: - JTO/ouDtWgTB8fO8ngHceQk+AxIup8tWClaKEFCOqiE1N5gC2TEVN2CiKch2tmE6/Pj2NXJH9DoGFEpz5WBB7A== txhash: E0EDE9B200AB0B9FF33DA288BC9E455C228854D76D5AD12C80EA5138C6706D06
struggling to get it to work. currently gives: "failed to execute message; message index: 0: authorization not found: unauthorized" despite: $ agd query authz grants agoric1uh4ynz9h3ea9vc80tl30s4ykmcyqwfl0d7zelw agoric1prh40kcgtx4uxd870aye5swmqzdrfu4ggp5pfm grants: - authorization: '@type': /cosmos.authz.v1beta1.GenericAuthorization msg: /agoric.swingset.MsgWalletAction expiration: "2022-07-20T08:42:41Z"
@michaelfig noted he got |
re authz... perhaps cosmos/cosmjs#1155 provides a clue: maybe payload messages need the |
grant fails thusly: aminotypes.ts:38 Uncaught (in promise) Error: The message type '/cosmos.authz.v1beta1.MsgGrant' cannot be signed using the Amino JSON sign mode because this is not supported by chain. at AminoTypes.toAmino (aminotypes.ts:38:13) at signingstargateclient.ts:351:56 at Array.map (<anonymous>) at SigningStargateClient.signAmino (signingstargateclient.ts:351:27) at async SigningStargateClient.signAndBroadcast (signingstargateclient.ts:295:19) at async Object.authorizeLocalKey (keyManagement.js:350:18) and submit offer thusly: Uncaught (in promise) Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (14), sequence (0) and chain-id (agoric): unauthorized at SigningStargateClient.broadcastTx (stargateclient.ts:413:9) at async Object.submitSpendAction (keyManagement.js:381:18)
still useful as a record of the journey, but this spike has been largely subsumed by other work |
refs: #4406, ##3628
Description
IOU
to run it:
Security Considerations
Documentation Considerations
Testing Considerations