Skip to content

Commit

Permalink
Update backend and contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Aug 2, 2021
1 parent 96177be commit 6f5e5e3
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 30 deletions.
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 @@ -309,12 +309,12 @@ describe("CosmWasmClient", () => {
it("works for instance with IBC port ID", async () => {
pendingWithoutWasmd();
const client = await CosmWasmClient.connect(wasmd.endpoint);
const contract = await client.getContract(deployedIbcReflect.instances[0]);
const contract = await client.getContract(deployedIbcReflect.instances[0].address);
expect(contract).toEqual(
jasmine.objectContaining({
address: deployedIbcReflect.instances[0],
address: deployedIbcReflect.instances[0].address,
codeId: deployedIbcReflect.codeId,
ibcPortId: "wasm.wasm1vjecguu37pmd577339wrdp208ddzymku8yy0te",
ibcPortId: deployedIbcReflect.instances[0].ibcPortId,
}),
);
});
Expand Down
8 changes: 4 additions & 4 deletions packages/cosmwasm-stargate/src/queries/wasm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe("WasmExtension", () => {
assertIsBroadcastTxSuccess(instantiateResult);
hackatomContractAddress = JSON.parse(instantiateResult.rawLog!)[0]
.events.find((event: any) => event.type === "message")
.attributes.find((attribute: any) => attribute.key === "contract_address").value;
.attributes.find((attribute: any) => attribute.key === "_contract_address").value;
}
});

Expand Down Expand Up @@ -204,7 +204,7 @@ describe("WasmExtension", () => {
assertIsBroadcastTxSuccess(result);
const myAddress = JSON.parse(result.rawLog!)[0]
.events.find((event: any) => event.type === "message")
.attributes!.find((attribute: any) => attribute.key === "contract_address").value;
.attributes!.find((attribute: any) => attribute.key === "_contract_address").value;

const { contracts: newContracts } = await client.wasm.listContractsByCodeId(hackatomCodeId);
assert(newContracts);
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("WasmExtension", () => {

const myAddress = JSON.parse(result.rawLog!)[0]
.events.find((event: any) => event.type === "message")
.attributes!.find((attribute: any) => attribute.key === "contract_address").value;
.attributes!.find((attribute: any) => attribute.key === "_contract_address").value;

const history = await client.wasm.getContractCodeHistory(myAddress);
assert(history.entries);
Expand Down Expand Up @@ -393,7 +393,7 @@ describe("WasmExtension", () => {
const result = await instantiateContract(wallet, codeId, beneficiaryAddress, funds);
assertIsBroadcastTxSuccess(result);
const parsedLogs = logs.parseLogs(logs.parseRawLog(result.rawLog));
const contractAddressAttr = logs.findAttribute(parsedLogs, "message", "contract_address");
const contractAddressAttr = logs.findAttribute(parsedLogs, "message", "_contract_address");
contractAddress = contractAddressAttr.value;
const amountAttr = logs.findAttribute(parsedLogs, "transfer", "amount");
expect(amountAttr.value).toEqual("1234ucosm,321ustake");
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmwasm-stargate/src/signingcosmwasmclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
throw new Error(createBroadcastTxErrorMessage(result));
}
const parsedLogs = logs.parseRawLog(result.rawLog);
const contractAddressAttr = logs.findAttribute(parsedLogs, "message", "contract_address");
const contractAddressAttr = logs.findAttribute(parsedLogs, "message", "_contract_address");
return {
contractAddress: contractAddressAttr.value,
logs: parsedLogs,
Expand Down
4 changes: 2 additions & 2 deletions packages/cosmwasm-stargate/src/testdata/contract.json

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions packages/cosmwasm-stargate/src/testutils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,21 @@ export const validator = {
/** Deployed as part of scripts/wasmd/init.sh */
export const deployedHackatom = {
codeId: 1,
checksum: "a32acdcfe15a2b3c8ba6963cf1e4ab63347725cc35a0f2434696dd492d63fb5f",
checksum: "841f5aa187a26018fee0f3398ecba404b3367af03f71e2b938bdc433328e14e9",
instances: [
{
beneficiary: alice.address0,
address: "wasm18vd8fpwxzck93qlwghaj6arh4p7c5n89k7fvsl",
address: "wasm14hj2tavq8fpesdwxxcu44rty3hh90vhujgqwg3",
label: "From deploy_hackatom.js (0)",
},
{
beneficiary: alice.address1,
address: "wasm1hqrdl6wstt8qzshwc6mrumpjk9338k0lffu40x",
address: "wasm1suhgf5svhu4usrurvxzlgn54ksxmn8glszahxx",
label: "From deploy_hackatom.js (1)",
},
{
beneficiary: alice.address2,
address: "wasm18r5szma8hm93pvx6lwpjwyxruw27e0k5kjkyan",
address: "wasm1yyca08xqdgvjz0psg56z67ejh9xms6l49ntww0",
label: "From deploy_hackatom.js (2)",
},
],
Expand All @@ -141,7 +141,12 @@ export const deployedHackatom = {
/** Deployed as part of scripts/wasmd/init.sh */
export const deployedIbcReflect = {
codeId: 2,
instances: ["wasm1vjecguu37pmd577339wrdp208ddzymku8yy0te"],
instances: [
{
address: "wasm1aakfpghcanxtc45gpqlx8j3rq0zcpyf4duy76f",
ibcPortId: "wasm.wasm1aakfpghcanxtc45gpqlx8j3rq0zcpyf4duy76f",
},
],
};

/** Deployed as part of scripts/wasmd/init.sh */
Expand Down
8 changes: 4 additions & 4 deletions scripts/wasmd/contracts/checksums.sha256
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
775f9f8fe7d2ca1ac33ec47799e9b8fd25aa1bf3cf97961f49f091b99e62f85b cw1_subkeys.wasm
3e3ea92c4ec35d90aa0bef344bdb0a94939120fce57265d5ff81bf8e8caec7e9 cw3_fixed_multisig.wasm
a32acdcfe15a2b3c8ba6963cf1e4ab63347725cc35a0f2434696dd492d63fb5f hackatom.wasm
089598e3cab468aff26233bc7363c713529124a0f7fd50320461cb58881a2da7 ibc_reflect.wasm
37f868eda7a723a769f6ff77cc27435455c3cff7b14481a114895d3d93cf8326 cw1_subkeys.wasm
203ceb9ffa61fdcb34b859a4d1249bec517112ecbaf9a9092b3787dc8199dde6 cw3_fixed_multisig.wasm
841f5aa187a26018fee0f3398ecba404b3367af03f71e2b938bdc433328e14e9 hackatom.wasm
70ec2710cd406f6496f165ca4939f921da5b95e708bd82e732dd790c1e8288a4 ibc_reflect.wasm
4 changes: 2 additions & 2 deletions scripts/wasmd/contracts/cw1_subkeys.wasm
Git LFS file not shown
4 changes: 2 additions & 2 deletions scripts/wasmd/contracts/cw3_fixed_multisig.wasm
Git LFS file not shown
4 changes: 2 additions & 2 deletions scripts/wasmd/contracts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# This must get from 2-3 different repos, fix the versions here:

COSMWASM_VERSION="v0.14.0"
PLUS_VERSION="v0.6.0"
COSMWASM_VERSION="v0.16.0-rc5"
PLUS_VERSION="v0.8.0-rc1"

curl -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/hackatom.wasm"
curl -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/ibc_reflect.wasm"
Expand Down
4 changes: 2 additions & 2 deletions scripts/wasmd/contracts/hackatom.wasm
Git LFS file not shown
4 changes: 2 additions & 2 deletions scripts/wasmd/contracts/ibc_reflect.wasm
Git LFS file not shown
2 changes: 1 addition & 1 deletion scripts/wasmd/env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags
REPOSITORY="cosmwasm/wasmd"
VERSION="v0.16.0"
VERSION="v0.18.0-rc1"

CONTAINER_NAME="wasmd"

0 comments on commit 6f5e5e3

Please sign in to comment.