-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
use coinAsset as "THOR.RUNE" as defined in the thorchain swap protocol
packages/chain-adapters/src/cosmossdk/thorchain/ThorchainChainAdapter.ts
Show resolved
Hide resolved
packages/chain-adapters/src/cosmossdk/thorchain/ThorchainChainAdapter.ts
Outdated
Show resolved
Hide resolved
packages/chain-adapters/src/cosmossdk/thorchain/ThorchainChainAdapter.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression tested while linked in web while manually applying this diff in the chain-adapters
dist. This can't be tested by linking, nor installing built module as this check fails (this is an issue I've definitely seen previously):
if (this.providers.http instanceof unchained.thorchain.V1Api) { |
Develop
Swap to RUNE
Swap from RUNE
- Doesn't go past the "Thorchain Account" step on the KK
This diff's chain-adapters
"linked"
Swap to RUNE
Swap from RUNE
…inChainAdapter.ts
packages/chain-adapters/src/cosmossdk/thorchain/ThorchainChainAdapter.ts
Outdated
Show resolved
Hide resolved
packages/chain-adapters/src/cosmossdk/thorchain/ThorchainChainAdapter.ts
Show resolved
Hide resolved
…inChainAdapter.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we simply can't loosen (i.e remove) the check in hdwallet-keepkey
which would result in invalid signatures for rune
as a coinAsset
, this is our best bet for now.
get in
# [@shapeshiftoss/chain-adapters-v11.2.2](https://github.com/shapeshift/lib/compare/@shapeshiftoss/chain-adapters-v11.2.1...@shapeshiftoss/chain-adapters-v11.2.2) (2023-04-04) ### Bug Fixes * keepkey swaps from RUNE ([#1231](#1231)) ([eb889d6](eb889d6))
🎉 This PR is included in version @shapeshiftoss/chain-adapters-v11.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes swaps from RUNE when using a KeepKey.
Uses "THOR.RUNE" as a
thorchain/MsgDeposit
MsgType coin asset, as defined in the THORChain protocol:https://dev.thorchain.org/thorchain-dev/concepts/memos#asset-notation
The reason is hdwallet-keepkey has stronger validation, and the
rune
coin asset we currently use doesn't pass validation there:https://github.com/shapeshift/hdwallet/blob/925de40aac9a2e3cafe09c5f33f5cc42417461bd/packages/hdwallet-keepkey/src/thorchain.ts#L96-L98
See the shape of a "valid" message (in
hdwallet-keepkey
terms) here: https://github.com/shapeshift/hdwallet/blob/925de40aac9a2e3cafe09c5f33f5cc42417461bd/integration/src/thorchain/tx01.mainnet.thorchain.swap.json#L15-L29Note that this is NOT a limitation of the network. This is actually an arbitrary check of
hdwallet-keepkey
, and bothrune
andTHOR.RUNE
are actually valid variants in the Thorchain world, see: https://gitlab.com/thorchain/thornode/-/blob/622179d8bf966f7a14ea8074e521914461d521ce/common/asset_test.go#L31-33Unfortunately, confirmed by monkey-patching
hdwallet-keepkey
to allowrune
instead ofTHOR.RUNE
that KeepKey produces an invalid signature while using therune
variant, which seems to indicate a firmware arbitrary limitation.