Merge pull request #609 from cosmos/update-wasmd-0.14-simon
Update wasmd 0.14 (Simon edition)
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
"coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet",
|
||||
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js",
|
||||
"preget-proto": "shx rm -rf proto",
|
||||
"get-proto": "WASM_REF=v0.13.0 COSMOS_REF=v0.40.0-rc3 ./scripts/get-proto.sh",
|
||||
"get-proto": "WASM_REF=v0.14.0-rc2 COSMOS_REF=v0.40.0-rc7 ./scripts/get-proto.sh",
|
||||
"predefine-proto": "./scripts/predefine-proto.sh",
|
||||
"define-proto": "./scripts/define-proto.sh",
|
||||
"postdefine-proto": "prettier --write \"src/codec/generated/codecimpl.*\""
|
||||
|
||||
@@ -19,8 +19,8 @@ yarn pbjs \
|
||||
--no-verify \
|
||||
--no-convert \
|
||||
--force-long \
|
||||
"$WASM_PROTO_DIR/internal/types/msg.proto" \
|
||||
"$WASM_PROTO_DIR/internal/types/query.proto" \
|
||||
"$WASM_PROTO_DIR/internal/types/tx.proto" \
|
||||
"$WASM_PROTO_DIR/internal/types/types.proto" \
|
||||
"$COSMOS_PROTO_DIR/base/v1beta1/coin.proto" \
|
||||
"$COSMOS_PROTO_DIR/base/query/v1beta1/pagination.proto"
|
||||
|
||||
+902
-2342
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ import {
|
||||
parseRawLog,
|
||||
SigningStargateClient,
|
||||
} from "@cosmjs/stargate";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import { assert, assertDefined } from "@cosmjs/utils";
|
||||
import Long from "long";
|
||||
|
||||
import { cosmwasm } from "../codec";
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
base64Matcher,
|
||||
bech32AddressMatcher,
|
||||
ContractUploadInstructions,
|
||||
fromOneElementArray,
|
||||
getHackatom,
|
||||
makeRandomAddress,
|
||||
makeWasmClient,
|
||||
@@ -27,7 +28,14 @@ import {
|
||||
wasmdEnabled,
|
||||
} from "../testutils.spec";
|
||||
|
||||
const { MsgExecuteContract, MsgInstantiateContract, MsgStoreCode } = cosmwasm.wasm.v1beta1;
|
||||
const {
|
||||
MsgExecuteContract,
|
||||
MsgExecuteContractResponse,
|
||||
MsgInstantiateContract,
|
||||
MsgInstantiateContractResponse,
|
||||
MsgStoreCode,
|
||||
MsgStoreCodeResponse,
|
||||
} = cosmwasm.wasm.v1beta1;
|
||||
|
||||
const registry = new Registry([
|
||||
["/cosmwasm.wasm.v1beta1.MsgExecuteContract", MsgExecuteContract],
|
||||
@@ -386,11 +394,13 @@ describe("WasmExtension", () => {
|
||||
codeId = Number.parseInt(codeIdAttr.value, 10);
|
||||
expect(codeId).toBeGreaterThanOrEqual(1);
|
||||
expect(codeId).toBeLessThanOrEqual(200);
|
||||
expect(result.data!.length).toEqual(1);
|
||||
expect({ ...result.data![0] }).toEqual({
|
||||
msgType: "store-code",
|
||||
data: toAscii(`${codeId}`),
|
||||
});
|
||||
|
||||
assertDefined(result.data);
|
||||
const msgData = fromOneElementArray(result.data);
|
||||
expect(msgData.msgType).toEqual("store-code");
|
||||
expect(MsgStoreCodeResponse.decode(msgData.data!)).toEqual(
|
||||
MsgStoreCodeResponse.create({ codeId: Long.fromNumber(codeId, true) }),
|
||||
);
|
||||
}
|
||||
|
||||
let contractAddress: string;
|
||||
@@ -404,11 +414,13 @@ describe("WasmExtension", () => {
|
||||
contractAddress = contractAddressAttr.value;
|
||||
const amountAttr = logs.findAttribute(parsedLogs, "transfer", "amount");
|
||||
expect(amountAttr.value).toEqual("1234ucosm,321ustake");
|
||||
expect(result.data!.length).toEqual(1);
|
||||
expect({ ...result.data![0] }).toEqual({
|
||||
msgType: "instantiate",
|
||||
data: toAscii(contractAddress),
|
||||
});
|
||||
|
||||
assertDefined(result.data);
|
||||
const msgData = fromOneElementArray(result.data);
|
||||
expect(msgData.msgType).toEqual("instantiate");
|
||||
expect(MsgInstantiateContractResponse.decode(msgData.data!)).toEqual(
|
||||
MsgInstantiateContractResponse.create({ address: contractAddress }),
|
||||
);
|
||||
|
||||
const balanceUcosm = await client.bank.balance(contractAddress, "ucosm");
|
||||
expect(balanceUcosm).toEqual(transferAmount[0]);
|
||||
@@ -420,11 +432,6 @@ describe("WasmExtension", () => {
|
||||
{
|
||||
const result = await executeContract(wallet, contractAddress, { release: {} });
|
||||
assertIsBroadcastTxSuccess(result);
|
||||
expect(result.data!.length).toEqual(1);
|
||||
expect({ ...result.data![0] }).toEqual({
|
||||
msgType: "execute",
|
||||
data: fromHex("F00BAA"),
|
||||
});
|
||||
const parsedLogs = logs.parseLogs(parseRawLog(result.rawLog));
|
||||
const wasmEvent = parsedLogs.find(() => true)?.events.find((e) => e.type === "wasm");
|
||||
assert(wasmEvent, "Event of type wasm expected");
|
||||
@@ -434,6 +441,13 @@ describe("WasmExtension", () => {
|
||||
value: beneficiaryAddress,
|
||||
});
|
||||
|
||||
assertDefined(result.data);
|
||||
const msgData = fromOneElementArray(result.data);
|
||||
expect(msgData.msgType).toEqual("execute");
|
||||
expect(MsgExecuteContractResponse.decode(msgData.data!)).toEqual(
|
||||
MsgExecuteContractResponse.create({ data: fromHex("F00BAA") }),
|
||||
);
|
||||
|
||||
// Verify token transfer from contract to beneficiary
|
||||
const beneficiaryBalanceUcosm = await client.bank.balance(beneficiaryAddress, "ucosm");
|
||||
expect(beneficiaryBalanceUcosm).toEqual(transferAmount[0]);
|
||||
|
||||
+902
-2342
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags
|
||||
REPOSITORY="cosmwasm/wasmd"
|
||||
VERSION="v0.13.0"
|
||||
VERSION="v0.14.0-rc2"
|
||||
|
||||
CONTAINER_NAME="wasmd"
|
||||
|
||||
Reference in New Issue
Block a user