-
Notifications
You must be signed in to change notification settings - Fork 96
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
Upgrade cosmos and thorchain to use 0.42.14 cosmos-client #436
Conversation
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.
Could we bump / publish xchain-cosmos|thorchain
packages as an alpha
version first? A lot of changes comes with this PR and it would be worth to see it in a "real" environment (for example in ASGARDEX desktop).
xchain-thorchain@0.20.0-alpha1
xchain-cosmos@0.14.0-alpha1
@@ -26,7 +27,7 @@ export type TransferParams = { | |||
amount: BigSource | |||
asset: string | |||
memo?: string | |||
fee?: string | |||
gasLimit?: BaseAmount |
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.
gasLimit?: BaseAmount` -> `gasLimit?: BigNumber
(Sorry, I was wrong with a previous review comment it needs to be a BaseAmount
, but still a BigNumber
and not a string
)
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.
ok i ended up going with this, which is what other clients use for amount/gasLimit
export type TransferParams = {
privkey: proto.cosmos.crypto.secp256k1.PrivKey
from: string
to: string
amount: BaseAmount
asset: string
memo?: string
gasLimit?: BigNumber
}
1. `git clone https://gitlab.com/thorchain/thornode` | ||
2. run the following (adjust the paths acordingly) to generate a typecript file for MsgDeposit | ||
```bash | ||
yarn run pbjs -w commonjs -t static-module <path to repo>/thornode/proto/thorchain/v1/x/thorchain/types/msg_deposit.proto <path to repo>/thornode/proto/thorchain/v1/common/common.proto -o src/types/MsgDeposit.js |
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.
How about to add a bash script for doing all these steps (clone repo, run pbjs, copy types, remove cloned repo) to make sure, an user can do it easily by running yarn generate:msg
. cosmos-client-ts
does it similar (:eyes: see gen-proto.sh). Not needed with this PR - pls create an issue for it.
packages/xchain-thorchain/__e2e__/thorchain-client.integration.ts
Outdated
Show resolved
Hide resolved
const privKey = this.getPrivateKey(walletIndex) | ||
const from = this.getAddress(walletIndex) | ||
const signer = privKey.pubKey() | ||
const accAddress = cosmosclient.AccAddress.fromString(from) |
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.
This returns address with wrong prefix - cosmos19kacmmyuf2ysyvq3t9nrl9495l5cvktj5c4eh4
instead of thor19kacmmyuf2ysyvq3t9nrl9495l5cvktj5c4eh4
.
Potential solution would be to override address prefixes with:
cosmosclient.config.setBech32Prefix({
accAddr: 'tthor',
accPub: 'tthorpub',
valAddr: 'tthorv',
valPub: 'tthorvpub',
consAddr: 'tthorc',
consPub: 'tthorcpub'
})
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.
@kustrun Good find! Could you push all your suggestions / fixes into this PR, pls? You have been added to xchain-*
as a collaborator to have write access, just check your email - thx!
const authInfo = new proto.cosmos.tx.v1beta1.AuthInfo({ | ||
signer_infos: [ | ||
{ | ||
public_key: cosmosclient.codec.packAny(signer), |
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.
Function call fails because PubKey
is not registered.
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.
@kustrun Any suggestion to fix it? Feel free to push it into this PR (see prev. message)
this.prefix + 'valcons', | ||
this.prefix + 'valconspub', | ||
) | ||
setBech32Prefix({ |
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.
Could this set
affect other packages like xchain-thorchain
as well if they are in the same project?. That is because you are changing/replacing global parameters
…K upgrade (#501) - This PR is a continuation of #436, which was originally opened by @mikewyszinski - A new PR was started as the upstream conflicts were extensive and it had been several months since the PR was touched - This PR prepares XChainJS for the hard-fork and upgrade to Cosmos v0.45: Steps taken: - Upgrade to @cosmos-client/core (new naming of same package): v0.44.4
closing since this was completed in a diff branch |
No description provided.