Skip to content

fix(store): preserve CosmosWallet default signOptions in getOfflineSigner (#42 + test update) - #46

Merged
pyramation merged 2 commits into
mainfrom
fix/pr42-sign-options-tests
Oct 1, 2026
Merged

pyramation merged 2 commits into
mainfrom
fix/pr42-sign-options-tests

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Mergeable version of #42 (@faneaatiku's commit kept as-is) plus the 2-line test update that PR still needs.

ChainWalletStore.getOfflineSigner() passed {} as signOptions to cosmosWallet.signAmino/signDirect. CosmosWallet falls back with signOptions || this.defaultSignOptions, so a truthy {} silently drops { preferNoSetFee: true } and Keplr replaces the app's fee with its own native-denom fee — breaking fee payment in non-native denoms.

- signAmino(chainId, signer, signDoc, {})
+ signAmino(chainId, signer, signDoc, undefined)

Second commit updates packages/store/__tests__/chain-wallet-store.test.ts to expect undefined (the two assertions that made pnpm test fail on #42). Full suite green on this branch merged with current main.

If you'd rather merge #42 directly, just land its author-side test fix instead; this PR exists so there's a green branch ready to go.

Link to Devin session: https://app.devin.ai/sessions/a02c84f654b94cbcb50936e98373fba5
Open in Devin Desktop: https://app.devin.ai/desktop/session/a02c84f654b94cbcb50936e98373fba5?variant=devin
Requested by: @pyramation

faneaatiku and others added 2 commits April 1, 2026 23:12
…alletStore

Fix `ChainWalletStore.getOfflineSigner()` passing `{}` instead of `undefined` as `signOptions` to `cosmosWallet.signAmino()` and `cosmosWallet.signDirect()`.

Problem
CosmosWallet in core defines defaultSignOptions = { preferNoSetFee: true } and applies them via signOptions || this.defaultSignOptions. Since {} is truthy, the fallback never triggers and the defaults are silently dropped.

Without preferNoSetFee: true, Keplr overrides the application-provided fee with its own calculation using the chain's native denom. This breaks any app that pays fees in a non-native denomination.

Fix
Pass undefined instead of {} for both signAmino and signDirect so the defaults in core are respected.
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

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.

2 participants