Upgrade CosmWasm to 0.9 (#245)
* Upgrade chain to v0.9.0-alpha4 * Update expected build_tags * Update wasmd init contracts * Update hackatom test contract * Update CosmWasm message descriptions * Make some test code more compact * Pull out InstantiateOptions * Add admin field to ContractInfo * Allow instantiating with admin * Remove some noise * Add SigningCosmWasmClient.updateAdmin * Create return type ChangeAdminResult * Add SigningCosmWasmClient.clearAdmin * Add SigningCosmWasmClient.migrate * Move message type testers close to type * Export MsgUpdateAdmin/isMsgUpdateAdmin * Fix typo in privillage * Update some test code * Test hackatom result data * Add compatibility table * Update wasmd to v0.9.0-beta * Upgrade test contracts
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
41b3bafd7f9a3870bbfb0a0620508df564c52499cdcdc67bf9df72262f3958a6 cw-erc20.wasm
|
||||
f4bba4289d150c0348ec42444fa142edd22ce5a024ad3314405c70314f3eb0fc cw-nameservice.wasm
|
||||
0f08a890443dbf644f61a7dc3aa7b2a03e9d142dd1b718aa8b7f8a80b886bff1 staking.wasm
|
||||
3e97bf88bd960fee5e5959c77b972eb2927690bc10160792741b174f105ec0c5 cw-erc20.wasm
|
||||
851aa8bbc76bc2326a38b99e1432bb06a8ed36442a68e9e676d10ed8beedd1d1 cw-nameservice.wasm
|
||||
44397b14c9ec35b3188d16b5ed46de2fb6397d7bf2d1f2755a9970054aa7abb0 staking.wasm
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,7 +22,7 @@ const guest = {
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/cw-erc20/0.4.0/download",
|
||||
source: "https://crates.io/api/v1/crates/cw-erc20/0.5.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.8.0",
|
||||
};
|
||||
|
||||
@@ -133,8 +133,9 @@ async function main() {
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
for (const initMsg of [initMsgHash, initMsgIsa, initMsgJade]) {
|
||||
const memo = `Create an ERC20 instance for ${initMsg.symbol}`;
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, initMsg.symbol, memo);
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, initMsg.symbol, {
|
||||
memo: `Create an ERC20 instance for ${initMsg.symbol}`,
|
||||
});
|
||||
console.info(`Contract instantiated for ${initMsg.symbol} at ${contractAddress}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ const alice = {
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/cw-nameservice/0.4.0/download",
|
||||
source: "https://crates.io/api/v1/crates/cw-nameservice/0.5.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.8.0",
|
||||
};
|
||||
|
||||
@@ -44,8 +44,9 @@ async function main() {
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
for (const { label, initMsg } of [free, luxury]) {
|
||||
const memo = `Create an nameservice instance "${label}"`;
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, label, memo);
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, label, {
|
||||
memo: `Create an nameservice instance "${label}"`,
|
||||
});
|
||||
console.info(`Contract "${label}" instantiated at ${contractAddress}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { Secp256k1Pen } = require("@cosmjs/sdk38");
|
||||
const { coins, Secp256k1Pen } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
const httpUrl = "http://localhost:1317";
|
||||
@@ -30,17 +30,25 @@ const bounty = {
|
||||
},
|
||||
};
|
||||
|
||||
const fees = {
|
||||
upload: {
|
||||
amount: coins(25000, "ucosm"),
|
||||
gas: "1500000", // 1.5 million
|
||||
},
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, (signBytes) => pen.sign(signBytes));
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, (signBytes) => pen.sign(signBytes), fees);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/staking.wasm");
|
||||
const uploadReceipt = await client.upload(wasm, codeMeta, "Upload Staking code");
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
for (const { label, initMsg } of [bounty]) {
|
||||
const memo = `Create an staking instance "${label}"`;
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, label, memo);
|
||||
const { contractAddress } = await client.instantiate(uploadReceipt.codeId, initMsg, label, {
|
||||
memo: `Create an staking instance "${label}"`,
|
||||
});
|
||||
console.info(`Contract "${label}" instantiated at ${contractAddress}`);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd-demo/tags
|
||||
REPOSITORY="cosmwasm/wasmd-demo"
|
||||
VERSION="v0.8.0"
|
||||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags
|
||||
REPOSITORY="cosmwasm/wasmd"
|
||||
VERSION="v0.9.0-beta"
|
||||
|
||||
CONTAINER_NAME="wasmd"
|
||||
|
||||
Reference in New Issue
Block a user