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: Apply lbm sdk v0.46.0-rc4 #30

Merged
merged 8 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .yarn/cache/cosmjs-types-npm-0.5.0-f6798779ac-caface3c6d.zip
Git LFS file not shown

This file was deleted.

Git LFS file not shown
2 changes: 1 addition & 1 deletion packages/cosmwasm-stargate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@lbmjs/ostracon-rpc": "workspace:packages/ostracon-rpc",
"@lbmjs/proto-signing": "workspace:packages/proto-signing",
"@lbmjs/stargate": "workspace:packages/stargate",
"lbmjs-types": "^0.46.0-rc2",
"lbmjs-types": "^0.46.0-rc4",
"long": "^4.0.0",
"pako": "^2.0.2",
"protobufjs": "~6.10.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
isDeliverTxSuccess,
isMsgSendEncodeObject,
} from "@lbmjs/stargate";
import { TxRaw } from "lbmjs-types/lbm/tx/v1/tx";
import { TxRaw } from "lbmjs-types/cosmos/tx/v1beta1/tx";

import { CosmWasmClient } from "./cosmwasmclient";
import {
Expand Down Expand Up @@ -56,11 +56,11 @@ async function sendTokens(
value: toBase64(pubkeyBytes),
});
const txBodyFields: TxBodyEncodeObject = {
typeUrl: "/lbm.tx.v1.TxBody",
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: [
{
typeUrl: "/lbm.bank.v1.MsgSend",
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
value: {
fromAddress: walletAddress,
toAddress: recipient,
Expand Down Expand Up @@ -354,7 +354,7 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
for (const result of results) {
const tx = decodeTxRaw(result.tx);
const msg = fromOneElementArray(tx.body.messages);
expect(msg.typeUrl).toEqual("/lbm.bank.v1.MsgSend");
expect(msg.typeUrl).toEqual("/cosmos.bank.v1beta1.MsgSend");
const decoded = registry.decode(msg);
expect(decoded.toAddress).toEqual(sendSuccessful.recipient);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TxBodyEncodeObject,
} from "@lbmjs/proto-signing";
import { assertIsDeliverTxSuccess, coins, logs, MsgSendEncodeObject, StdFee } from "@lbmjs/stargate";
import { TxRaw } from "lbmjs-types/lbm/tx/v1/tx";
import { TxRaw } from "lbmjs-types/cosmos/tx/v1beta1/tx";
import { ReadonlyDate } from "readonly-date";

import { Code, CosmWasmClient, PrivateCosmWasmClient } from "./cosmwasmclient";
Expand Down Expand Up @@ -180,7 +180,7 @@ describe("CosmWasmClient", () => {

const memo = "My first contract on chain";
const sendMsg: MsgSendEncodeObject = {
typeUrl: "/lbm.bank.v1.MsgSend",
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
value: {
fromAddress: alice.address0,
toAddress: makeRandomAddress(),
Expand All @@ -198,7 +198,7 @@ describe("CosmWasmClient", () => {
const { accountNumber, sequence } = sequenceResponse;
const pubkey = encodePubkey(alice.pubkey0);
const txBody: TxBodyEncodeObject = {
typeUrl: "/lbm.tx.v1.TxBody",
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: [sendMsg],
memo: memo,
Expand Down
42 changes: 21 additions & 21 deletions packages/cosmwasm-stargate/src/signingcosmwasmclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {
MsgDelegateEncodeObject,
MsgSendEncodeObject,
} from "@lbmjs/stargate";
import { DeepPartial, MsgSend } from "lbmjs-types/lbm/bank/v1/tx";
import { Coin } from "lbmjs-types/lbm/base/v1/coin";
import { MsgDelegate } from "lbmjs-types/lbm/staking/v1/tx";
import { AuthInfo, TxBody, TxRaw } from "lbmjs-types/lbm/tx/v1/tx";
import { DeepPartial, MsgSend } from "lbmjs-types/cosmos/bank/v1beta1/tx";
import { Coin } from "lbmjs-types/cosmos/base/v1beta1/coin";
import { MsgDelegate } from "lbmjs-types/cosmos/staking/v1beta1/tx";
import { AuthInfo, TxBody, TxRaw } from "lbmjs-types/cosmos/tx/v1beta1/tx";
import { MsgExecuteContract, MsgStoreCode } from "lbmjs-types/lbm/wasm/v1/tx";
import Long from "long";
import pako from "pako";
Expand Down Expand Up @@ -673,7 +673,7 @@ describe("SigningCosmWasmClient", () => {
...defaultSigningClientOptions,
prefix: wasmd.prefix,
});
const msgDelegateTypeUrl = "/lbm.staking.v1.MsgDelegate";
const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate";

const msg = MsgDelegate.fromPartial({
delegatorAddress: alice.address0,
Expand Down Expand Up @@ -703,7 +703,7 @@ describe("SigningCosmWasmClient", () => {
prefix: wasmd.prefix,
gasPrice: defaultGasPrice,
});
const msgDelegateTypeUrl = "/lbm.staking.v1.MsgDelegate";
const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate";

const msg = MsgDelegate.fromPartial({
delegatorAddress: alice.address0,
Expand All @@ -730,7 +730,7 @@ describe("SigningCosmWasmClient", () => {
...defaultSigningClientOptions,
prefix: wasmd.prefix,
});
const msgDelegateTypeUrl = "/lbm.staking.v1.MsgDelegate";
const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate";

const msg = MsgDelegate.fromPartial({
delegatorAddress: alice.address0,
Expand Down Expand Up @@ -778,7 +778,7 @@ describe("SigningCosmWasmClient", () => {
amount: coins(1234, "cony"),
};
const msgAny: MsgSendEncodeObject = {
typeUrl: "/lbm.bank.v1.MsgSend",
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
value: msgSend,
};
const fee = {
Expand Down Expand Up @@ -807,7 +807,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
};
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msgDelegate,
};
const fee = {
Expand Down Expand Up @@ -855,7 +855,7 @@ describe("SigningCosmWasmClient", () => {
const wallet = await Secp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: wasmd.prefix });

const customRegistry = new Registry();
const msgDelegateTypeUrl = "/lbm.staking.v1.MsgDelegate";
const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate";
interface CustomMsgDelegate {
customDelegatorAddress?: string;
customValidatorAddress?: string;
Expand Down Expand Up @@ -913,7 +913,7 @@ describe("SigningCosmWasmClient", () => {
};
customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate);
const customAminoTypes = new AminoTypes({
"/lbm.staking.v1.MsgDelegate": {
"/cosmos.staking.v1beta1.MsgDelegate": {
aminoType: "lbm-sdk/MsgDelegate",
toAmino: ({
customDelegatorAddress,
Expand Down Expand Up @@ -959,7 +959,7 @@ describe("SigningCosmWasmClient", () => {
customAmount: coin(1234, "stake"),
};
const msgAny = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down Expand Up @@ -990,7 +990,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
};
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down Expand Up @@ -1032,7 +1032,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
});
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down Expand Up @@ -1065,7 +1065,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
});
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down Expand Up @@ -1105,7 +1105,7 @@ describe("SigningCosmWasmClient", () => {
amount: coins(1234, "cony"),
};
const msgAny: MsgSendEncodeObject = {
typeUrl: "/lbm.bank.v1.MsgSend",
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
value: msgSend,
};
const fee = {
Expand Down Expand Up @@ -1137,7 +1137,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
};
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msgDelegate,
};
const fee = {
Expand All @@ -1159,7 +1159,7 @@ describe("SigningCosmWasmClient", () => {
const wallet = await Secp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: wasmd.prefix });

const customRegistry = new Registry();
const msgDelegateTypeUrl = "/lbm.staking.v1.MsgDelegate";
const msgDelegateTypeUrl = "/cosmos.staking.v1beta1.MsgDelegate";
interface CustomMsgDelegate {
customDelegatorAddress?: string;
customValidatorAddress?: string;
Expand Down Expand Up @@ -1217,7 +1217,7 @@ describe("SigningCosmWasmClient", () => {
};
customRegistry.register(msgDelegateTypeUrl, CustomMsgDelegate);
const customAminoTypes = new AminoTypes({
"/lbm.staking.v1.MsgDelegate": {
"/cosmos.staking.v1beta1.MsgDelegate": {
aminoType: "lbm-sdk/MsgDelegate",
toAmino: ({
customDelegatorAddress,
Expand Down Expand Up @@ -1260,7 +1260,7 @@ describe("SigningCosmWasmClient", () => {
customAmount: coin(1234, "stake"),
};
const msgAny = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down Expand Up @@ -1294,7 +1294,7 @@ describe("SigningCosmWasmClient", () => {
amount: coin(1234, "stake"),
};
const msgAny: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: msg,
};
const fee = {
Expand Down
20 changes: 10 additions & 10 deletions packages/cosmwasm-stargate/src/signingcosmwasmclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import {
SignerData,
StdFee,
} from "@lbmjs/stargate";
import { MsgWithdrawDelegatorReward } from "lbmjs-types/lbm/distribution/v1/tx";
import { MsgDelegate, MsgUndelegate } from "lbmjs-types/lbm/staking/v1/tx";
import { SignMode } from "lbmjs-types/lbm/tx/signing/v1/signing";
import { TxRaw } from "lbmjs-types/lbm/tx/v1/tx";
import { MsgWithdrawDelegatorReward } from "lbmjs-types/cosmos/distribution/v1beta1/tx";
import { MsgDelegate, MsgUndelegate } from "lbmjs-types/cosmos/staking/v1beta1/tx";
import { SignMode } from "lbmjs-types/cosmos/tx/signing/v1beta1/signing";
import { TxRaw } from "lbmjs-types/cosmos/tx/v1beta1/tx";
import {
MsgClearAdmin,
MsgExecuteContract,
Expand Down Expand Up @@ -496,7 +496,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
memo = "",
): Promise<DeliverTxResponse> {
const sendMsg: MsgSendEncodeObject = {
typeUrl: "/lbm.bank.v1.MsgSend",
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
value: {
fromAddress: senderAddress,
toAddress: recipientAddress,
Expand All @@ -514,7 +514,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
memo = "",
): Promise<DeliverTxResponse> {
const delegateMsg: MsgDelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgDelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
value: MsgDelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }),
};
return this.signAndBroadcast(delegatorAddress, [delegateMsg], fee, memo);
Expand All @@ -528,7 +528,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
memo = "",
): Promise<DeliverTxResponse> {
const undelegateMsg: MsgUndelegateEncodeObject = {
typeUrl: "/lbm.staking.v1.MsgUndelegate",
typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate",
value: MsgUndelegate.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress, amount }),
};
return this.signAndBroadcast(delegatorAddress, [undelegateMsg], fee, memo);
Expand All @@ -541,7 +541,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
memo = "",
): Promise<DeliverTxResponse> {
const withdrawDelegatorRewardMsg: MsgWithdrawDelegatorRewardEncodeObject = {
typeUrl: "/lbm.distribution.v1.MsgWithdrawDelegatorReward",
typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
value: MsgWithdrawDelegatorReward.fromPartial({ delegatorAddress: delegatorAddress, validatorAddress }),
};
return this.signAndBroadcast(delegatorAddress, [withdrawDelegatorRewardMsg], fee, memo);
Expand Down Expand Up @@ -620,7 +620,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
const signDoc = makeSignDocAmino(msgs, fee, chainId, memo, accountNumber, sequence);
const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc);
const signedTxBody: TxBodyEncodeObject = {
typeUrl: "/lbm.tx.v1.TxBody",
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: signed.msgs.map((msg) => this.aminoTypes.fromAmino(msg)),
memo: signed.memo,
Expand Down Expand Up @@ -658,7 +658,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
}
const pubkey = encodePubkey(encodeSecp256k1Pubkey(accountFromSigner.pubkey));
const txBody: TxBodyEncodeObject = {
typeUrl: "/lbm.tx.v1.TxBody",
typeUrl: "/cosmos.tx.v1beta1.TxBody",
value: {
messages: messages,
memo: memo,
Expand Down
8 changes: 4 additions & 4 deletions packages/cosmwasm-stargate/src/testutils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
setupAuthExtension,
setupBankExtension,
} from "@lbmjs/stargate";
import { SignMode } from "lbmjs-types/lbm/tx/signing/v1/signing";
import { AuthInfo, SignDoc, TxBody } from "lbmjs-types/lbm/tx/v1/tx";
import { SignMode } from "lbmjs-types/cosmos/tx/signing/v1beta1/signing";
import { AuthInfo, SignDoc, TxBody } from "lbmjs-types/cosmos/tx/v1beta1/tx";

import { setupWasmExtension, WasmExtension } from "./modules";
import { SigningCosmWasmClientOptions } from "./signingcosmwasmclient";
Expand Down Expand Up @@ -101,13 +101,13 @@ export const unused = {

export const validator = {
/**
* delegator_address from /lbm.staking.v1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
* delegator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
*
* `jq ".app_state.genutil.gen_txs[0].body.messages[0].delegator_address" scripts/wasmd/template/.wasmd/config/genesis.json`
*/
delegatorAddress: "link146asaycmtydq45kxc8evntqfgepagygelel00h",
/**
* validator_address from /lbm.staking.v1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
* validator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
*
* `jq ".app_state.genutil.gen_txs[0].body.messages[0].validator_address" scripts/wasmd/template/.wasmd/config/genesis.json`
*/
Expand Down
Loading