Skip to content

Commit

Permalink
support lbm sdk 0.46.0 rc7 (#33)
Browse files Browse the repository at this point in the history
* chore: change lbmjs-types version and add proto-signing

* feat: support lbmjs-types 0.46.0-rc7 in stargate

* chore: add init.sh to support cosmwasm stargate test

* feat: support lbmjs-tyeps 0.46.0-rc7 in cosmwasm-stargate

* chore: change lbmjs-types import to cosmjs-types when it is possible

* chore: change CodeInfoResponse to be import from cosmjs

Co-authored-by: jinseong.cho <[email protected]>
  • Loading branch information
loin3 and loin3 authored Aug 26, 2022
1 parent 8f22dac commit 3292218
Show file tree
Hide file tree
Showing 29 changed files with 362 additions and 115 deletions.
14 changes: 8 additions & 6 deletions .pnp.cjs

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

This file was deleted.

Git LFS file not shown
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"devDependencies": {
"@cosmjs/crypto": "0.28.4",
"@cosmjs/encoding": "0.28.4",
"@cosmjs/proto-signing": "0.28.4",
"@lbmjs/cosmwasm-stargate": "workspace:packages/cosmwasm-stargate",
"@lbmjs/stargate": "workspace:packages/stargate",
"eslint": "^7.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmwasm-stargate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@cosmjs/tendermint-rpc": "0.28.4",
"@cosmjs/utils": "0.28.4",
"cosmjs-types": "0.4.0",
"lbmjs-types": "0.46.0-rc6",
"lbmjs-types": "^0.46.0-rc7",
"long": "^4.0.0",
"pako": "^2.0.2",
"protobufjs": "~6.10.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/cosmwasm-stargate/src/cosmwasmclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import {
CodeInfoResponse,
QueryCodesResponse,
QueryContractsByCodeResponse,
} from "lbmjs-types/lbm/wasm/v1/query";
import { ContractCodeHistoryOperationType } from "lbmjs-types/lbm/wasm/v1/types";
} from "cosmjs-types/cosmwasm/wasm/v1/query";
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1/types";

import { JsonObject, setupWasmExtension, WasmExtension } from "./modules";

Expand Down
30 changes: 15 additions & 15 deletions packages/cosmwasm-stargate/src/modules/wasm/aminomessages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MsgMigrateContract,
MsgStoreCode,
MsgUpdateAdmin,
} from "lbmjs-types/lbm/wasm/v1/tx";
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
import Long from "long";

import {
Expand All @@ -30,7 +30,7 @@ describe("AminoTypes", () => {
instantiatePermission: undefined,
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgStoreCode",
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
value: msg,
});
const expected: AminoMsgStoreCode = {
Expand All @@ -55,7 +55,7 @@ describe("AminoTypes", () => {
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgInstantiateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
value: msg,
});
const expected: AminoMsgInstantiateContract = {
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("AminoTypes", () => {
admin: "",
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgInstantiateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
value: msg,
});
const expected: AminoMsgInstantiateContract = {
Expand All @@ -109,7 +109,7 @@ describe("AminoTypes", () => {
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgUpdateAdmin",
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
value: msg,
});
const expected: AminoMsgUpdateAdmin = {
Expand All @@ -129,7 +129,7 @@ describe("AminoTypes", () => {
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgClearAdmin",
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
value: msg,
});
const expected: AminoMsgClearAdmin = {
Expand All @@ -150,7 +150,7 @@ describe("AminoTypes", () => {
funds: coins(1234, "cony"),
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgExecuteContract",
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: msg,
});
const expected: AminoMsgExecuteContract = {
Expand All @@ -173,7 +173,7 @@ describe("AminoTypes", () => {
msg: toUtf8(`{"foo":"bar"}`),
};
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
typeUrl: "/lbm.wasm.v1.MsgMigrateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
value: msg,
});
const expected: AminoMsgMigrateContract = {
Expand Down Expand Up @@ -205,7 +205,7 @@ describe("AminoTypes", () => {
instantiatePermission: undefined,
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgStoreCode",
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
value: expectedValue,
});
});
Expand Down Expand Up @@ -234,7 +234,7 @@ describe("AminoTypes", () => {
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgInstantiateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
value: expectedValue,
});
}
Expand All @@ -261,7 +261,7 @@ describe("AminoTypes", () => {
admin: "",
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgInstantiateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
value: expectedValue,
});
}
Expand All @@ -283,7 +283,7 @@ describe("AminoTypes", () => {
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgUpdateAdmin",
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
value: expectedValue,
});
});
Expand All @@ -302,7 +302,7 @@ describe("AminoTypes", () => {
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgClearAdmin",
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
value: expectedValue,
});
});
Expand All @@ -325,7 +325,7 @@ describe("AminoTypes", () => {
funds: coins(1234, "cony"),
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgExecuteContract",
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: expectedValue,
});
});
Expand All @@ -348,7 +348,7 @@ describe("AminoTypes", () => {
msg: toUtf8(`{"foo":"bar"}`),
};
expect(msg).toEqual({
typeUrl: "/lbm.wasm.v1.MsgMigrateContract",
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
value: expectedValue,
});
});
Expand Down
14 changes: 7 additions & 7 deletions packages/cosmwasm-stargate/src/modules/wasm/aminomessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MsgMigrateContract,
MsgStoreCode,
MsgUpdateAdmin,
} from "lbmjs-types/lbm/wasm/v1/tx";
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
import Long from "long";

// TODO: implement
Expand Down Expand Up @@ -126,7 +126,7 @@ export interface AminoMsgClearAdmin {

export function createWasmAminoConverters(): AminoConverters {
return {
"/lbm.wasm.v1.MsgStoreCode": {
"/cosmwasm.wasm.v1.MsgStoreCode": {
aminoType: "wasm/MsgStoreCode",
toAmino: ({ sender, wasmByteCode }: MsgStoreCode): AminoMsgStoreCode["value"] => ({
sender: sender,
Expand All @@ -138,7 +138,7 @@ export function createWasmAminoConverters(): AminoConverters {
instantiatePermission: undefined,
}),
},
"/lbm.wasm.v1.MsgInstantiateContract": {
"/cosmwasm.wasm.v1.MsgInstantiateContract": {
aminoType: "wasm/MsgInstantiateContract",
toAmino: ({
sender,
Expand Down Expand Up @@ -171,7 +171,7 @@ export function createWasmAminoConverters(): AminoConverters {
admin: admin ?? "",
}),
},
"/lbm.wasm.v1.MsgUpdateAdmin": {
"/cosmwasm.wasm.v1.MsgUpdateAdmin": {
aminoType: "wasm/MsgUpdateAdmin",
toAmino: ({ sender, newAdmin, contract }: MsgUpdateAdmin): AminoMsgUpdateAdmin["value"] => ({
sender: sender,
Expand All @@ -184,7 +184,7 @@ export function createWasmAminoConverters(): AminoConverters {
contract: contract,
}),
},
"/lbm.wasm.v1.MsgClearAdmin": {
"/cosmwasm.wasm.v1.MsgClearAdmin": {
aminoType: "wasm/MsgClearAdmin",
toAmino: ({ sender, contract }: MsgClearAdmin): AminoMsgClearAdmin["value"] => ({
sender: sender,
Expand All @@ -195,7 +195,7 @@ export function createWasmAminoConverters(): AminoConverters {
contract: contract,
}),
},
"/lbm.wasm.v1.MsgExecuteContract": {
"/cosmwasm.wasm.v1.MsgExecuteContract": {
aminoType: "wasm/MsgExecuteContract",
toAmino: ({ sender, contract, msg, funds }: MsgExecuteContract): AminoMsgExecuteContract["value"] => ({
sender: sender,
Expand All @@ -215,7 +215,7 @@ export function createWasmAminoConverters(): AminoConverters {
funds: [...funds],
}),
},
"/lbm.wasm.v1.MsgMigrateContract": {
"/cosmwasm.wasm.v1.MsgMigrateContract": {
aminoType: "wasm/MsgMigrateContract",
toAmino: ({ sender, contract, codeId, msg }: MsgMigrateContract): AminoMsgMigrateContract["value"] => ({
sender: sender,
Expand Down
Loading

0 comments on commit 3292218

Please sign in to comment.