Merge pull request #863 from cosmos/upgrade-to-wasmd-0.18
Upgrade CosmWasm to wasmd 0.18
This commit is contained in:
commit
aabca4f9f9
16
.pnp.js
generated
16
.pnp.js
generated
@ -1032,7 +1032,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
],
|
||||
[
|
||||
"cosmjs-types",
|
||||
"npm:0.1.0"
|
||||
"npm:0.2.0"
|
||||
],
|
||||
[
|
||||
"create-hash",
|
||||
@ -3276,7 +3276,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["axios", "npm:0.21.1"],
|
||||
["babylon", "npm:6.18.0"],
|
||||
["colors", "npm:1.4.0"],
|
||||
["cosmjs-types", "npm:0.1.0"],
|
||||
["cosmjs-types", "npm:0.2.0"],
|
||||
["diff", "npm:4.0.2"],
|
||||
["eslint", "npm:7.26.0"],
|
||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||
@ -3322,7 +3322,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@types/pako", "npm:1.0.1"],
|
||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["cosmjs-types", "npm:0.1.0"],
|
||||
["cosmjs-types", "npm:0.2.0"],
|
||||
["eslint", "npm:7.26.0"],
|
||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||
@ -3760,7 +3760,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@types/node", "npm:15.3.1"],
|
||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["cosmjs-types", "npm:0.1.0"],
|
||||
["cosmjs-types", "npm:0.2.0"],
|
||||
["eslint", "npm:7.26.0"],
|
||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||
@ -3864,7 +3864,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@types/node", "npm:15.3.1"],
|
||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||
["cosmjs-types", "npm:0.1.0"],
|
||||
["cosmjs-types", "npm:0.2.0"],
|
||||
["eslint", "npm:7.26.0"],
|
||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||
@ -6990,10 +6990,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
}]
|
||||
]],
|
||||
["cosmjs-types", [
|
||||
["npm:0.1.0", {
|
||||
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.1.0-309209b1b4-ca08e65750.zip/node_modules/cosmjs-types/",
|
||||
["npm:0.2.0", {
|
||||
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.2.0-a3cb5ee5af-2c3215a9a2.zip/node_modules/cosmjs-types/",
|
||||
"packageDependencies": [
|
||||
["cosmjs-types", "npm:0.1.0"],
|
||||
["cosmjs-types", "npm:0.2.0"],
|
||||
["long", "npm:4.0.0"],
|
||||
["protobufjs", "npm:6.11.2"]
|
||||
],
|
||||
|
||||
BIN
.yarn/cache/cosmjs-types-npm-0.1.0-309209b1b4-ca08e65750.zip
(Stored with Git LFS)
vendored
BIN
.yarn/cache/cosmjs-types-npm-0.1.0-309209b1b4-ca08e65750.zip
(Stored with Git LFS)
vendored
Binary file not shown.
BIN
.yarn/cache/cosmjs-types-npm-0.2.0-a3cb5ee5af-2c3215a9a2.zip
(Stored with Git LFS)
vendored
Normal file
BIN
.yarn/cache/cosmjs-types-npm-0.2.0-a3cb5ee5af-2c3215a9a2.zip
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
10
CHANGELOG.md
10
CHANGELOG.md
@ -50,6 +50,16 @@ and this project adheres to
|
||||
where there is no previous block.
|
||||
- @cosmjs/proto-signing: `makeAuthInfoBytes` now takes an array of pubkey
|
||||
sequence pairs in order to support different sequences for different signers.
|
||||
- @cosmjs/cosmwasm-stargate: Upgraded client to support wasmd 0.18 backends.
|
||||
Other backends are not supported anymore. Update proto types from
|
||||
`cosmwasm.wasm.v1beta1.*` to `cosmwasm.wasm.v1.*`. `MsgStoreCode.source` and
|
||||
`MsgStoreCode.builder` were removed; `MsgInstantiateContract.initMsg` and
|
||||
`MsgMigrateContract.migrateMsg` were renamed to `msg`; `Code.{source,builder}`
|
||||
and `CodeDetails.{source,builder}` were removed; `isValidBuilder` was removed;
|
||||
`UploadMeta` and the `meta` from `SigningCosmWasmClient.upload` were removed.
|
||||
([#863])
|
||||
|
||||
[#863]: https://github.com/cosmos/cosmjs/pull/863
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
@ -23,15 +23,10 @@ async function main(hackatomWasmPath: string) {
|
||||
// Upload contract
|
||||
const wasm = fs.readFileSync(hackatomWasmPath);
|
||||
const uploadFee = calculateFee(1_500_000, gasPrice);
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/hackatom/not-yet-released/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.8",
|
||||
};
|
||||
const uploadReceipt = await client.upload(
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
codeMeta,
|
||||
"Upload hackatom contract",
|
||||
);
|
||||
console.info("Upload succeeded. Receipt:", uploadReceipt);
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
"axios": "^0.21.1",
|
||||
"babylon": "^6.18.0",
|
||||
"colors": "^1.3.3",
|
||||
"cosmjs-types": "^0.1.0",
|
||||
"cosmjs-types": "^0.2.0",
|
||||
"diff": "^4",
|
||||
"recast": "^0.20",
|
||||
"ts-node": "^8",
|
||||
|
||||
@ -8,6 +8,7 @@ An SDK to build CosmWasm clients.
|
||||
|
||||
| CosmWasm | x/wasm | @cosmjs/cosmwasm-stargate |
|
||||
| -------- | --------- | ------------------------- |
|
||||
| 0.16 | 0.18 | `^0.26.0` |
|
||||
| 0.14 | 0.16 | `^0.25.0` |
|
||||
| 0.13 | 0.14-0.15 | `^0.24.0` |
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
"@cosmjs/stargate": "workspace:packages/stargate",
|
||||
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
||||
"@cosmjs/utils": "workspace:packages/utils",
|
||||
"cosmjs-types": "^0.1.0",
|
||||
"cosmjs-types": "^0.2.0",
|
||||
"long": "^4.0.0",
|
||||
"pako": "^2.0.2",
|
||||
"protobufjs": "~6.10.2"
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
import Long from "long";
|
||||
|
||||
import {
|
||||
@ -27,12 +27,10 @@ describe("AminoTypes", () => {
|
||||
const msg: MsgStoreCode = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
wasmByteCode: fromBase64("WUVMTE9XIFNVQk1BUklORQ=="),
|
||||
source: "Arrabiata",
|
||||
builder: "Bob",
|
||||
instantiatePermission: undefined,
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgStoreCode = {
|
||||
@ -40,8 +38,6 @@ describe("AminoTypes", () => {
|
||||
value: {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
wasm_byte_code: "WUVMTE9XIFNVQk1BUklORQ==",
|
||||
source: "Arrabiata",
|
||||
builder: "Bob",
|
||||
},
|
||||
};
|
||||
expect(aminoMsg).toEqual(expected);
|
||||
@ -52,7 +48,7 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
codeId: Long.fromString("12345"),
|
||||
label: "sticky",
|
||||
initMsg: toUtf8(
|
||||
msg: toUtf8(
|
||||
JSON.stringify({
|
||||
foo: "bar",
|
||||
}),
|
||||
@ -61,7 +57,7 @@ describe("AminoTypes", () => {
|
||||
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgInstantiateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgInstantiateContract = {
|
||||
@ -70,7 +66,7 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
code_id: "12345",
|
||||
label: "sticky",
|
||||
init_msg: {
|
||||
msg: {
|
||||
foo: "bar",
|
||||
},
|
||||
funds: coins(1234, "ucosm"),
|
||||
@ -87,7 +83,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgUpdateAdmin = {
|
||||
@ -107,7 +103,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgClearAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgClearAdmin = {
|
||||
@ -132,7 +128,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgExecuteContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgExecuteContract = {
|
||||
@ -154,14 +150,14 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
codeId: Long.fromString("98765"),
|
||||
migrateMsg: toUtf8(
|
||||
msg: toUtf8(
|
||||
JSON.stringify({
|
||||
foo: "bar",
|
||||
}),
|
||||
),
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ additions: cosmWasmTypes }).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgMigrateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
|
||||
value: msg,
|
||||
});
|
||||
const expected: AminoMsgMigrateContract = {
|
||||
@ -186,20 +182,16 @@ describe("AminoTypes", () => {
|
||||
value: {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
wasm_byte_code: "WUVMTE9XIFNVQk1BUklORQ==",
|
||||
source: "Arrabiata",
|
||||
builder: "Bob",
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ additions: cosmWasmTypes }).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgStoreCode = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
wasmByteCode: fromBase64("WUVMTE9XIFNVQk1BUklORQ=="),
|
||||
source: "Arrabiata",
|
||||
builder: "Bob",
|
||||
instantiatePermission: undefined,
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
@ -211,7 +203,7 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
code_id: "12345",
|
||||
label: "sticky",
|
||||
init_msg: {
|
||||
msg: {
|
||||
foo: "bar",
|
||||
},
|
||||
funds: coins(1234, "ucosm"),
|
||||
@ -223,7 +215,7 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
codeId: Long.fromString("12345"),
|
||||
label: "sticky",
|
||||
initMsg: toUtf8(
|
||||
msg: toUtf8(
|
||||
JSON.stringify({
|
||||
foo: "bar",
|
||||
}),
|
||||
@ -232,7 +224,7 @@ describe("AminoTypes", () => {
|
||||
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgInstantiateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
@ -253,7 +245,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
@ -272,7 +264,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgClearAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
@ -301,7 +293,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgExecuteContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
@ -323,14 +315,14 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
codeId: Long.fromString("98765"),
|
||||
migrateMsg: toUtf8(
|
||||
msg: toUtf8(
|
||||
JSON.stringify({
|
||||
foo: "bar",
|
||||
}),
|
||||
),
|
||||
};
|
||||
expect(msg).toEqual({
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgMigrateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
|
||||
value: expectedValue,
|
||||
});
|
||||
});
|
||||
|
||||
@ -8,18 +8,19 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
import Long from "long";
|
||||
|
||||
// TODO: implement
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/types.proto#L30-L35
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/types.proto#L36-L41
|
||||
*/
|
||||
type AccessConfig = never;
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L28-L40
|
||||
* The Amino JSON representation of [MsgStoreCode].
|
||||
*
|
||||
* [MsgStoreCode]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L28-L39
|
||||
*/
|
||||
export interface AminoMsgStoreCode {
|
||||
type: "wasm/MsgStoreCode";
|
||||
@ -28,17 +29,14 @@ export interface AminoMsgStoreCode {
|
||||
readonly sender: string;
|
||||
/** Base64 encoded Wasm */
|
||||
readonly wasm_byte_code: string;
|
||||
/** A valid URI reference to the contract's source code. Can be empty. */
|
||||
readonly source: string;
|
||||
/** A docker tag. Can be empty. */
|
||||
readonly builder: string;
|
||||
readonly instantiate_permission?: AccessConfig;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L70-L80
|
||||
* The Amino JSON representation of [MsgExecuteContract].
|
||||
*
|
||||
* [MsgExecuteContract]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L73-L86
|
||||
*/
|
||||
export interface AminoMsgExecuteContract {
|
||||
type: "wasm/MsgExecuteContract";
|
||||
@ -54,8 +52,9 @@ export interface AminoMsgExecuteContract {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L47-L61
|
||||
* The Amino JSON representation of [MsgInstantiateContract].
|
||||
*
|
||||
* [MsgInstantiateContract]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L46-L64
|
||||
*/
|
||||
export interface AminoMsgInstantiateContract {
|
||||
type: "wasm/MsgInstantiateContract";
|
||||
@ -66,8 +65,8 @@ export interface AminoMsgInstantiateContract {
|
||||
readonly code_id: string;
|
||||
/** Human-readable label for this contract */
|
||||
readonly label: string;
|
||||
/** Init message as JavaScript object */
|
||||
readonly init_msg: any;
|
||||
/** Instantiate message as JavaScript object */
|
||||
readonly msg: any;
|
||||
readonly funds: readonly Coin[];
|
||||
/** Bech32-encoded admin address */
|
||||
readonly admin?: string;
|
||||
@ -75,8 +74,9 @@ export interface AminoMsgInstantiateContract {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L88-L98
|
||||
* The Amino JSON representation of [MsgMigrateContract].
|
||||
*
|
||||
* [MsgMigrateContract]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L94-L104
|
||||
*/
|
||||
export interface AminoMsgMigrateContract {
|
||||
type: "wasm/MsgMigrateContract";
|
||||
@ -93,8 +93,9 @@ export interface AminoMsgMigrateContract {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L107-L115
|
||||
* The Amino JSON representation of [MsgUpdateAdmin].
|
||||
*
|
||||
* [MsgUpdateAdmin]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L113-L121
|
||||
*/
|
||||
export interface AminoMsgUpdateAdmin {
|
||||
type: "wasm/MsgUpdateAdmin";
|
||||
@ -109,8 +110,9 @@ export interface AminoMsgUpdateAdmin {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L120-L126
|
||||
* The Amino JSON representation of [MsgClearAdmin].
|
||||
*
|
||||
* [MsgClearAdmin]: https://github.com/CosmWasm/wasmd/blob/v0.18.0-rc1/proto/cosmwasm/wasm/v1/tx.proto#L126-L132
|
||||
*/
|
||||
export interface AminoMsgClearAdmin {
|
||||
type: "wasm/MsgClearAdmin";
|
||||
@ -123,36 +125,32 @@ export interface AminoMsgClearAdmin {
|
||||
}
|
||||
|
||||
export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
"/cosmwasm.wasm.v1beta1.MsgStoreCode": {
|
||||
"/cosmwasm.wasm.v1.MsgStoreCode": {
|
||||
aminoType: "wasm/MsgStoreCode",
|
||||
toAmino: ({ sender, wasmByteCode, source, builder }: MsgStoreCode): AminoMsgStoreCode["value"] => ({
|
||||
toAmino: ({ sender, wasmByteCode }: MsgStoreCode): AminoMsgStoreCode["value"] => ({
|
||||
sender: sender,
|
||||
wasm_byte_code: toBase64(wasmByteCode),
|
||||
source: source,
|
||||
builder: builder,
|
||||
}),
|
||||
fromAmino: ({ sender, wasm_byte_code, source, builder }: AminoMsgStoreCode["value"]): MsgStoreCode => ({
|
||||
fromAmino: ({ sender, wasm_byte_code }: AminoMsgStoreCode["value"]): MsgStoreCode => ({
|
||||
sender: sender,
|
||||
wasmByteCode: fromBase64(wasm_byte_code),
|
||||
source: source,
|
||||
builder: builder,
|
||||
instantiatePermission: undefined,
|
||||
}),
|
||||
},
|
||||
"/cosmwasm.wasm.v1beta1.MsgInstantiateContract": {
|
||||
"/cosmwasm.wasm.v1.MsgInstantiateContract": {
|
||||
aminoType: "wasm/MsgInstantiateContract",
|
||||
toAmino: ({
|
||||
sender,
|
||||
codeId,
|
||||
label,
|
||||
initMsg,
|
||||
msg,
|
||||
funds,
|
||||
admin,
|
||||
}: MsgInstantiateContract): AminoMsgInstantiateContract["value"] => ({
|
||||
sender: sender,
|
||||
code_id: codeId.toString(),
|
||||
label: label,
|
||||
init_msg: JSON.parse(fromUtf8(initMsg)),
|
||||
msg: JSON.parse(fromUtf8(msg)),
|
||||
funds: funds,
|
||||
admin: admin ?? undefined,
|
||||
}),
|
||||
@ -160,19 +158,19 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
sender,
|
||||
code_id,
|
||||
label,
|
||||
init_msg,
|
||||
msg,
|
||||
funds,
|
||||
admin,
|
||||
}: AminoMsgInstantiateContract["value"]): MsgInstantiateContract => ({
|
||||
sender: sender,
|
||||
codeId: Long.fromString(code_id),
|
||||
label: label,
|
||||
initMsg: toUtf8(JSON.stringify(init_msg)),
|
||||
msg: toUtf8(JSON.stringify(msg)),
|
||||
funds: [...funds],
|
||||
admin: admin ?? "",
|
||||
}),
|
||||
},
|
||||
"/cosmwasm.wasm.v1beta1.MsgUpdateAdmin": {
|
||||
"/cosmwasm.wasm.v1.MsgUpdateAdmin": {
|
||||
aminoType: "wasm/MsgUpdateAdmin",
|
||||
toAmino: ({ sender, newAdmin, contract }: MsgUpdateAdmin): AminoMsgUpdateAdmin["value"] => ({
|
||||
sender: sender,
|
||||
@ -185,7 +183,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
contract: contract,
|
||||
}),
|
||||
},
|
||||
"/cosmwasm.wasm.v1beta1.MsgClearAdmin": {
|
||||
"/cosmwasm.wasm.v1.MsgClearAdmin": {
|
||||
aminoType: "wasm/MsgClearAdmin",
|
||||
toAmino: ({ sender, contract }: MsgClearAdmin): AminoMsgClearAdmin["value"] => ({
|
||||
sender: sender,
|
||||
@ -196,7 +194,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
contract: contract,
|
||||
}),
|
||||
},
|
||||
"/cosmwasm.wasm.v1beta1.MsgExecuteContract": {
|
||||
"/cosmwasm.wasm.v1.MsgExecuteContract": {
|
||||
aminoType: "wasm/MsgExecuteContract",
|
||||
toAmino: ({ sender, contract, msg, funds }: MsgExecuteContract): AminoMsgExecuteContract["value"] => ({
|
||||
sender: sender,
|
||||
@ -211,18 +209,13 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
funds: [...funds],
|
||||
}),
|
||||
},
|
||||
"/cosmwasm.wasm.v1beta1.MsgMigrateContract": {
|
||||
"/cosmwasm.wasm.v1.MsgMigrateContract": {
|
||||
aminoType: "wasm/MsgMigrateContract",
|
||||
toAmino: ({
|
||||
sender,
|
||||
contract,
|
||||
codeId,
|
||||
migrateMsg,
|
||||
}: MsgMigrateContract): AminoMsgMigrateContract["value"] => ({
|
||||
toAmino: ({ sender, contract, codeId, msg }: MsgMigrateContract): AminoMsgMigrateContract["value"] => ({
|
||||
sender: sender,
|
||||
contract: contract,
|
||||
code_id: codeId.toString(),
|
||||
msg: JSON.parse(fromUtf8(migrateMsg)),
|
||||
msg: JSON.parse(fromUtf8(msg)),
|
||||
}),
|
||||
fromAmino: ({
|
||||
sender,
|
||||
@ -233,7 +226,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
sender: sender,
|
||||
contract: contract,
|
||||
codeId: Long.fromString(code_id),
|
||||
migrateMsg: toUtf8(JSON.stringify(msg)),
|
||||
msg: toUtf8(JSON.stringify(msg)),
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
import { isValidBuilder } from "./builder";
|
||||
|
||||
describe("builder", () => {
|
||||
describe("isValidBuilder", () => {
|
||||
// Valid cases
|
||||
|
||||
it("returns true for simple examples", () => {
|
||||
expect(isValidBuilder("myorg/super-optimizer:0.1.2")).toEqual(true);
|
||||
expect(isValidBuilder("myorg/super-optimizer:42")).toEqual(true);
|
||||
});
|
||||
|
||||
it("supports images with multi level names", () => {
|
||||
expect(isValidBuilder("myorg/department-x/office-y/technology-z/super-optimizer:0.1.2")).toEqual(true);
|
||||
});
|
||||
|
||||
it("returns true for tags with lower and upper chars", () => {
|
||||
expect(isValidBuilder("myorg/super-optimizer:0.1.2-alpha")).toEqual(true);
|
||||
expect(isValidBuilder("myorg/super-optimizer:0.1.2-Alpha")).toEqual(true);
|
||||
});
|
||||
|
||||
// Invalid cases
|
||||
|
||||
it("returns false for missing or empty tag", () => {
|
||||
expect(isValidBuilder("myorg/super-optimizer")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/super-optimizer:")).toEqual(false);
|
||||
});
|
||||
|
||||
it("returns false for name components starting or ending with a separator", () => {
|
||||
expect(isValidBuilder(".myorg/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("-myorg/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("_myorg/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg./super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg-/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg_/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/.super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/-super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/_super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/super-optimizer.:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/super-optimizer-:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/super-optimizer_:42")).toEqual(false);
|
||||
});
|
||||
|
||||
it("returns false for upper case character in name component", () => {
|
||||
expect(isValidBuilder("mYorg/super-optimizer:42")).toEqual(false);
|
||||
expect(isValidBuilder("myorg/super-Optimizer:42")).toEqual(false);
|
||||
});
|
||||
|
||||
it("returns false for long images", () => {
|
||||
expect(
|
||||
isValidBuilder(
|
||||
"myorgisnicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenice/super-optimizer:42",
|
||||
),
|
||||
).toEqual(false);
|
||||
});
|
||||
|
||||
it("returns false for images with no organization", () => {
|
||||
// Those are valid dockerhub images from https://hub.docker.com/_/ubuntu and https://hub.docker.com/_/rust
|
||||
// but not valid in the context of CosmWasm Verify
|
||||
expect(isValidBuilder("ubuntu:xenial-20200212")).toEqual(false);
|
||||
expect(isValidBuilder("rust:1.40.0")).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,20 +0,0 @@
|
||||
// A docker image regexp. We remove support for non-standard registries for simplicity.
|
||||
// https://docs.docker.com/engine/reference/commandline/tag/#extended-description
|
||||
//
|
||||
// An image name is made up of slash-separated name components (optionally prefixed by a registry hostname).
|
||||
// Name components may contain lowercase characters, digits and separators.
|
||||
// A separator is defined as a period, one or two underscores, or one or more dashes. A name component may not start or end with a separator.
|
||||
//
|
||||
// A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes.
|
||||
// A tag name may not start with a period or a dash and may contain a maximum of 128 characters.
|
||||
const dockerImagePattern = new RegExp(
|
||||
"^[a-z0-9][a-z0-9._-]*[a-z0-9](/[a-z0-9][a-z0-9._-]*[a-z0-9])+:[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$",
|
||||
);
|
||||
|
||||
/** Max length in bytes/characters (regexp enforces all ASCII, even if that is not required by the standard) */
|
||||
const builderMaxLength = 128;
|
||||
|
||||
export function isValidBuilder(builder: string): boolean {
|
||||
if (builder.length > builderMaxLength) return false;
|
||||
return !!builder.match(dockerImagePattern);
|
||||
}
|
||||
@ -229,8 +229,6 @@ describe("CosmWasmClient", () => {
|
||||
const [first] = result;
|
||||
expect(first).toEqual({
|
||||
id: deployedHackatom.codeId,
|
||||
source: deployedHackatom.source,
|
||||
builder: deployedHackatom.builder,
|
||||
checksum: deployedHackatom.checksum,
|
||||
creator: alice.address0,
|
||||
});
|
||||
@ -245,8 +243,6 @@ describe("CosmWasmClient", () => {
|
||||
|
||||
const expectedInfo: Code = {
|
||||
id: deployedHackatom.codeId,
|
||||
source: deployedHackatom.source,
|
||||
builder: deployedHackatom.builder,
|
||||
checksum: deployedHackatom.checksum,
|
||||
creator: alice.address0,
|
||||
};
|
||||
@ -313,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,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@ -23,8 +23,8 @@ import {
|
||||
} from "@cosmjs/stargate";
|
||||
import { Tendermint34Client, toRfc3339WithNanoseconds } from "@cosmjs/tendermint-rpc";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
import { CodeInfoResponse } from "cosmjs-types/cosmwasm/wasm/v1beta1/query";
|
||||
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1beta1/types";
|
||||
import { CodeInfoResponse } from "cosmjs-types/cosmwasm/wasm/v1/query";
|
||||
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1/types";
|
||||
|
||||
import { JsonObject, setupWasmExtension, WasmExtension } from "./queries";
|
||||
|
||||
@ -39,19 +39,9 @@ export interface Code {
|
||||
readonly creator: string;
|
||||
/** Hex-encoded sha256 hash of the code stored here */
|
||||
readonly checksum: string;
|
||||
/**
|
||||
* An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly source?: string;
|
||||
/**
|
||||
* A docker image (including version) to reproducibly build the Wasm bytecode from the source code.
|
||||
*
|
||||
* @example ```cosmwasm/rust-optimizer:0.8.0```
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly builder?: string;
|
||||
|
||||
// `source` and `builder` were removed in wasmd 0.18
|
||||
// https://github.com/CosmWasm/wasmd/issues/540
|
||||
}
|
||||
|
||||
export interface CodeDetails extends Code {
|
||||
@ -317,8 +307,6 @@ export class CosmWasmClient {
|
||||
id: entry.codeId.toNumber(),
|
||||
creator: entry.creator,
|
||||
checksum: toHex(entry.dataHash),
|
||||
source: entry.source || undefined,
|
||||
builder: entry.builder || undefined,
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -336,8 +324,6 @@ export class CosmWasmClient {
|
||||
id: codeInfo.codeId.toNumber(),
|
||||
creator: codeInfo.creator,
|
||||
checksum: toHex(codeInfo.dataHash),
|
||||
source: codeInfo.source || undefined,
|
||||
builder: codeInfo.builder || undefined,
|
||||
data: data,
|
||||
};
|
||||
this.codesCache.set(codeId, codeDetails);
|
||||
|
||||
@ -6,21 +6,21 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
|
||||
export interface MsgStoreCodeEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode";
|
||||
readonly value: Partial<MsgStoreCode>;
|
||||
}
|
||||
|
||||
export function isMsgStoreCodeEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgStoreCodeEncodeObject {
|
||||
return (encodeObject as MsgStoreCodeEncodeObject).typeUrl === "/cosmwasm.wasm.v1beta1.MsgStoreCode";
|
||||
return (encodeObject as MsgStoreCodeEncodeObject).typeUrl === "/cosmwasm.wasm.v1.MsgStoreCode";
|
||||
}
|
||||
|
||||
export interface MsgInstantiateContractEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgInstantiateContract";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract";
|
||||
readonly value: Partial<MsgInstantiateContract>;
|
||||
}
|
||||
|
||||
@ -29,54 +29,50 @@ export function isMsgInstantiateContractEncodeObject(
|
||||
): encodeObject is MsgInstantiateContractEncodeObject {
|
||||
return (
|
||||
(encodeObject as MsgInstantiateContractEncodeObject).typeUrl ===
|
||||
"/cosmwasm.wasm.v1beta1.MsgInstantiateContract"
|
||||
"/cosmwasm.wasm.v1.MsgInstantiateContract"
|
||||
);
|
||||
}
|
||||
|
||||
export interface MsgUpdateAdminEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin";
|
||||
readonly value: Partial<MsgUpdateAdmin>;
|
||||
}
|
||||
|
||||
export function isMsgUpdateAdminEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgUpdateAdminEncodeObject {
|
||||
return (encodeObject as MsgUpdateAdminEncodeObject).typeUrl === "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin";
|
||||
return (encodeObject as MsgUpdateAdminEncodeObject).typeUrl === "/cosmwasm.wasm.v1.MsgUpdateAdmin";
|
||||
}
|
||||
|
||||
export interface MsgClearAdminEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgClearAdmin";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin";
|
||||
readonly value: Partial<MsgClearAdmin>;
|
||||
}
|
||||
|
||||
export function isMsgClearAdminEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgClearAdminEncodeObject {
|
||||
return (encodeObject as MsgClearAdminEncodeObject).typeUrl === "/cosmwasm.wasm.v1beta1.MsgClearAdmin";
|
||||
return (encodeObject as MsgClearAdminEncodeObject).typeUrl === "/cosmwasm.wasm.v1.MsgClearAdmin";
|
||||
}
|
||||
|
||||
export interface MsgMigrateContractEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgMigrateContract";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract";
|
||||
readonly value: Partial<MsgMigrateContract>;
|
||||
}
|
||||
|
||||
export function isMsgMigrateEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgMigrateContractEncodeObject {
|
||||
return (
|
||||
(encodeObject as MsgMigrateContractEncodeObject).typeUrl === "/cosmwasm.wasm.v1beta1.MsgMigrateContract"
|
||||
);
|
||||
return (encodeObject as MsgMigrateContractEncodeObject).typeUrl === "/cosmwasm.wasm.v1.MsgMigrateContract";
|
||||
}
|
||||
|
||||
export interface MsgExecuteContractEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgExecuteContract";
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract";
|
||||
readonly value: Partial<MsgExecuteContract>;
|
||||
}
|
||||
|
||||
export function isMsgExecuteEncodeObject(
|
||||
encodeObject: EncodeObject,
|
||||
): encodeObject is MsgExecuteContractEncodeObject {
|
||||
return (
|
||||
(encodeObject as MsgExecuteContractEncodeObject).typeUrl === "/cosmwasm.wasm.v1beta1.MsgExecuteContract"
|
||||
);
|
||||
return (encodeObject as MsgExecuteContractEncodeObject).typeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract";
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
export { cosmWasmTypes } from "./aminotypes";
|
||||
export { isValidBuilder } from "./builder";
|
||||
export {
|
||||
Code,
|
||||
CodeDetails,
|
||||
@ -30,6 +29,5 @@ export {
|
||||
MigrateResult,
|
||||
SigningCosmWasmClient,
|
||||
SigningCosmWasmClientOptions,
|
||||
UploadMeta,
|
||||
UploadResult,
|
||||
} from "./signingcosmwasmclient";
|
||||
|
||||
@ -13,12 +13,8 @@ import {
|
||||
StdFee,
|
||||
} from "@cosmjs/stargate";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import {
|
||||
MsgExecuteContract,
|
||||
MsgInstantiateContract,
|
||||
MsgStoreCode,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1beta1/types";
|
||||
import { MsgExecuteContract, MsgInstantiateContract, MsgStoreCode } from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1/types";
|
||||
import Long from "long";
|
||||
|
||||
import {
|
||||
@ -41,9 +37,9 @@ import {
|
||||
} from "../testutils.spec";
|
||||
|
||||
const registry = new Registry([
|
||||
["/cosmwasm.wasm.v1beta1.MsgExecuteContract", MsgExecuteContract],
|
||||
["/cosmwasm.wasm.v1beta1.MsgStoreCode", MsgStoreCode],
|
||||
["/cosmwasm.wasm.v1beta1.MsgInstantiateContract", MsgInstantiateContract],
|
||||
["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract],
|
||||
["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode],
|
||||
["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract],
|
||||
]);
|
||||
|
||||
async function uploadContract(
|
||||
@ -52,12 +48,10 @@ async function uploadContract(
|
||||
): Promise<BroadcastTxResponse> {
|
||||
const memo = "My first contract on chain";
|
||||
const theMsg: MsgStoreCodeEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: MsgStoreCode.fromPartial({
|
||||
sender: alice.address0,
|
||||
wasmByteCode: contract.data,
|
||||
source: contract.source || "",
|
||||
builder: contract.builder || "",
|
||||
}),
|
||||
};
|
||||
const fee: StdFee = {
|
||||
@ -80,12 +74,12 @@ async function instantiateContract(
|
||||
): Promise<BroadcastTxResponse> {
|
||||
const memo = "Create an escrow instance";
|
||||
const theMsg: MsgInstantiateContractEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgInstantiateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: MsgInstantiateContract.fromPartial({
|
||||
sender: alice.address0,
|
||||
codeId: Long.fromNumber(codeId),
|
||||
label: "my escrow",
|
||||
initMsg: toAscii(
|
||||
msg: toAscii(
|
||||
JSON.stringify({
|
||||
verifier: alice.address0,
|
||||
beneficiary: beneficiaryAddress,
|
||||
@ -114,7 +108,7 @@ async function executeContract(
|
||||
): Promise<BroadcastTxResponse> {
|
||||
const memo = "Time for action";
|
||||
const theMsg: MsgExecuteContractEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgExecuteContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
||||
value: MsgExecuteContract.fromPartial({
|
||||
sender: alice.address0,
|
||||
contract: contractAddress,
|
||||
@ -157,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;
|
||||
}
|
||||
});
|
||||
|
||||
@ -171,8 +165,6 @@ describe("WasmExtension", () => {
|
||||
const lastCode = codeInfos[codeInfos.length - 1];
|
||||
expect(lastCode.codeId.toNumber()).toEqual(hackatomCodeId);
|
||||
expect(lastCode.creator).toEqual(alice.address0);
|
||||
expect(lastCode.source).toEqual(hackatom.source ?? "");
|
||||
expect(lastCode.builder).toEqual(hackatom.builder ?? "");
|
||||
expect(toHex(lastCode.dataHash)).toEqual(toHex(sha256(hackatom.data)));
|
||||
});
|
||||
});
|
||||
@ -183,11 +175,10 @@ describe("WasmExtension", () => {
|
||||
assert(hackatomCodeId);
|
||||
const client = await makeWasmClient(wasmd.endpoint);
|
||||
const { codeInfo, data } = await client.wasm.getCode(hackatomCodeId);
|
||||
expect(codeInfo!.codeId.toNumber()).toEqual(hackatomCodeId);
|
||||
expect(codeInfo!.creator).toEqual(alice.address0);
|
||||
expect(codeInfo!.source).toEqual(hackatom.source ?? "");
|
||||
expect(codeInfo!.builder).toEqual(hackatom.builder ?? "");
|
||||
expect(toHex(codeInfo!.dataHash)).toEqual(toHex(sha256(hackatom.data)));
|
||||
assert(codeInfo);
|
||||
expect(codeInfo.codeId.toNumber()).toEqual(hackatomCodeId);
|
||||
expect(codeInfo.creator).toEqual(alice.address0);
|
||||
expect(toHex(codeInfo.dataHash)).toEqual(toHex(sha256(hackatom.data)));
|
||||
expect(data).toEqual(hackatom.data);
|
||||
});
|
||||
});
|
||||
@ -213,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);
|
||||
@ -257,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);
|
||||
@ -402,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");
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
QueryContractInfoResponse,
|
||||
QueryContractsByCodeResponse,
|
||||
QueryRawContractStateResponse,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/query";
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1/query";
|
||||
import Long from "long";
|
||||
|
||||
/**
|
||||
|
||||
@ -17,13 +17,13 @@ import { DeepPartial, MsgSend } from "cosmjs-types/cosmos/bank/v1beta1/tx";
|
||||
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
||||
import { MsgDelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
||||
import { AuthInfo, TxBody, TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
||||
import { MsgStoreCode } from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
import { MsgStoreCode } from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
import Long from "long";
|
||||
import pako from "pako";
|
||||
import protobuf from "protobufjs/minimal";
|
||||
|
||||
import { MsgStoreCodeEncodeObject } from "./encodeobjects";
|
||||
import { SigningCosmWasmClient, UploadMeta } from "./signingcosmwasmclient";
|
||||
import { SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
import {
|
||||
alice,
|
||||
defaultClearAdminFee,
|
||||
@ -86,22 +86,6 @@ describe("SigningCosmWasmClient", () => {
|
||||
expect(codeId).toBeGreaterThanOrEqual(1);
|
||||
client.disconnect();
|
||||
});
|
||||
|
||||
it("can set builder and source", async () => {
|
||||
pendingWithoutWasmd();
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: wasmd.prefix });
|
||||
const options = { prefix: wasmd.prefix };
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(wasmd.endpoint, wallet, options);
|
||||
const hackatom = getHackatom();
|
||||
const meta: UploadMeta = {
|
||||
source: "https://crates.io/api/v1/crates/cw-nameservice/0.1.0/download",
|
||||
builder: "confio/cosmwasm-opt:0.6.2",
|
||||
};
|
||||
const { codeId } = await client.upload(alice.address0, hackatom.data, defaultUploadFee, meta);
|
||||
const codeDetails = await client.getCodeDetails(codeId);
|
||||
expect(codeDetails.source).toEqual(meta.source);
|
||||
expect(codeDetails.builder).toEqual(meta.builder);
|
||||
});
|
||||
});
|
||||
|
||||
describe("instantiate", () => {
|
||||
@ -571,17 +555,15 @@ describe("SigningCosmWasmClient", () => {
|
||||
...defaultSigningClientOptions,
|
||||
prefix: wasmd.prefix,
|
||||
});
|
||||
const { data, builder, source } = getHackatom();
|
||||
const { data } = getHackatom();
|
||||
|
||||
const msgStoreCode: MsgStoreCode = {
|
||||
sender: alice.address0,
|
||||
wasmByteCode: pako.gzip(data),
|
||||
source: source ?? "",
|
||||
builder: builder ?? "",
|
||||
instantiatePermission: undefined,
|
||||
};
|
||||
const msgAny: MsgStoreCodeEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: msgStoreCode,
|
||||
};
|
||||
const fee = {
|
||||
|
||||
@ -41,12 +41,11 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1beta1/tx";
|
||||
} from "cosmjs-types/cosmwasm/wasm/v1/tx";
|
||||
import Long from "long";
|
||||
import pako from "pako";
|
||||
|
||||
import { cosmWasmTypes } from "./aminotypes";
|
||||
import { isValidBuilder } from "./builder";
|
||||
import { CosmWasmClient } from "./cosmwasmclient";
|
||||
import {
|
||||
MsgClearAdminEncodeObject,
|
||||
@ -57,31 +56,6 @@ import {
|
||||
MsgUpdateAdminEncodeObject,
|
||||
} from "./encodeobjects";
|
||||
|
||||
function prepareBuilder(builder: string | undefined): string | undefined {
|
||||
if (!builder) {
|
||||
return undefined;
|
||||
} else {
|
||||
if (!isValidBuilder(builder)) throw new Error("The builder (Docker Hub image with tag) is not valid");
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
export interface UploadMeta {
|
||||
/**
|
||||
* An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly source?: string;
|
||||
/**
|
||||
* A docker image (including version) to reproducibly build the Wasm bytecode from the source code.
|
||||
*
|
||||
* @example ```cosmwasm/rust-optimizer:0.8.0```
|
||||
* @see https://github.com/CosmWasm/cosmwasm-verify
|
||||
*/
|
||||
readonly builder?: string;
|
||||
}
|
||||
|
||||
export interface UploadResult {
|
||||
/** Size of the original wasm code in bytes */
|
||||
readonly originalSize: number;
|
||||
@ -155,12 +129,12 @@ function createBroadcastTxErrorMessage(result: BroadcastTxFailure): string {
|
||||
function createDefaultRegistry(): Registry {
|
||||
return new Registry([
|
||||
...defaultRegistryTypes,
|
||||
["/cosmwasm.wasm.v1beta1.MsgClearAdmin", MsgClearAdmin],
|
||||
["/cosmwasm.wasm.v1beta1.MsgExecuteContract", MsgExecuteContract],
|
||||
["/cosmwasm.wasm.v1beta1.MsgMigrateContract", MsgMigrateContract],
|
||||
["/cosmwasm.wasm.v1beta1.MsgStoreCode", MsgStoreCode],
|
||||
["/cosmwasm.wasm.v1beta1.MsgInstantiateContract", MsgInstantiateContract],
|
||||
["/cosmwasm.wasm.v1beta1.MsgUpdateAdmin", MsgUpdateAdmin],
|
||||
["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin],
|
||||
["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract],
|
||||
["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract],
|
||||
["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode],
|
||||
["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract],
|
||||
["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin],
|
||||
]);
|
||||
}
|
||||
|
||||
@ -227,19 +201,14 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
senderAddress: string,
|
||||
wasmCode: Uint8Array,
|
||||
fee: StdFee,
|
||||
meta: UploadMeta = {},
|
||||
memo = "",
|
||||
): Promise<UploadResult> {
|
||||
const source = meta.source || "";
|
||||
const builder = prepareBuilder(meta.builder);
|
||||
const compressed = pako.gzip(wasmCode, { level: 9 });
|
||||
const storeCodeMsg: MsgStoreCodeEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: MsgStoreCode.fromPartial({
|
||||
sender: senderAddress,
|
||||
wasmByteCode: compressed,
|
||||
source: source,
|
||||
builder: builder,
|
||||
}),
|
||||
};
|
||||
|
||||
@ -269,12 +238,12 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
options: InstantiateOptions = {},
|
||||
): Promise<InstantiateResult> {
|
||||
const instantiateContractMsg: MsgInstantiateContractEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgInstantiateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: MsgInstantiateContract.fromPartial({
|
||||
sender: senderAddress,
|
||||
codeId: Long.fromString(new Uint53(codeId).toString()),
|
||||
label: label,
|
||||
initMsg: toUtf8(JSON.stringify(msg)),
|
||||
msg: toUtf8(JSON.stringify(msg)),
|
||||
funds: [...(options.funds || [])],
|
||||
admin: options.admin,
|
||||
}),
|
||||
@ -284,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,
|
||||
@ -300,7 +269,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
memo = "",
|
||||
): Promise<ChangeAdminResult> {
|
||||
const updateAdminMsg: MsgUpdateAdminEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
||||
value: MsgUpdateAdmin.fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
@ -324,7 +293,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
memo = "",
|
||||
): Promise<ChangeAdminResult> {
|
||||
const clearAdminMsg: MsgClearAdminEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgClearAdmin",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
|
||||
value: MsgClearAdmin.fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
@ -349,12 +318,12 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
memo = "",
|
||||
): Promise<MigrateResult> {
|
||||
const migrateContractMsg: MsgMigrateContractEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgMigrateContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
|
||||
value: MsgMigrateContract.fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
codeId: Long.fromString(new Uint53(codeId).toString()),
|
||||
migrateMsg: toUtf8(JSON.stringify(migrateMsg)),
|
||||
msg: toUtf8(JSON.stringify(migrateMsg)),
|
||||
}),
|
||||
};
|
||||
const result = await this.signAndBroadcast(senderAddress, [migrateContractMsg], fee, memo);
|
||||
@ -376,7 +345,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
funds?: readonly Coin[],
|
||||
): Promise<ExecuteResult> {
|
||||
const executeContractMsg: MsgExecuteContractEncodeObject = {
|
||||
typeUrl: "/cosmwasm.wasm.v1beta1.MsgExecuteContract",
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
||||
value: MsgExecuteContract.fromPartial({
|
||||
sender: senderAddress,
|
||||
contract: contractAddress,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -39,8 +39,6 @@ export const defaultClearAdminFee = calculateFee(80_000, defaultGasPrice);
|
||||
export interface ContractUploadInstructions {
|
||||
/** The wasm bytecode */
|
||||
readonly data: Uint8Array;
|
||||
readonly source?: string;
|
||||
readonly builder?: string;
|
||||
}
|
||||
|
||||
export const wasmd = {
|
||||
@ -62,8 +60,6 @@ export const defaultSigningClientOptions: SigningCosmWasmClientOptions = {
|
||||
export function getHackatom(): ContractUploadInstructions {
|
||||
return {
|
||||
data: fromBase64(hackatom.data),
|
||||
source: "https://crates.io/api/v1/crates/hackatom/not-yet-released/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.9.1",
|
||||
};
|
||||
}
|
||||
|
||||
@ -122,23 +118,21 @@ export const validator = {
|
||||
/** Deployed as part of scripts/wasmd/init.sh */
|
||||
export const deployedHackatom = {
|
||||
codeId: 1,
|
||||
source: "https://crates.io/api/v1/crates/hackatom/not-yet-released/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.8",
|
||||
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)",
|
||||
},
|
||||
],
|
||||
@ -147,14 +141,17 @@ 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 */
|
||||
export const deployedCw3 = {
|
||||
codeId: 3,
|
||||
source: "https://crates.io/api/v1/crates/cw3-fixed-multisig/0.3.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.4",
|
||||
instances: [
|
||||
"wasm1xqeym28j9xgv0p93pwwt6qcxf9tdvf9z83duy9", // Multisig (1/3)
|
||||
"wasm1jka38ckju8cpjap00jf9xdvdyttz9cauchu0zl", // Multisig (2/3)
|
||||
@ -165,8 +162,6 @@ export const deployedCw3 = {
|
||||
/** Deployed as part of scripts/wasmd/init.sh */
|
||||
export const deployedCw1 = {
|
||||
codeId: 4,
|
||||
source: "https://crates.io/api/v1/crates/cw1-subkeys/0.3.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.4",
|
||||
instances: ["wasm1vs2vuks65rq7xj78mwtvn7vvnm2gn7ad78g6yp"],
|
||||
};
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
"@cosmjs/amino": "workspace:packages/amino",
|
||||
"@cosmjs/crypto": "workspace:packages/crypto",
|
||||
"@cosmjs/math": "workspace:packages/math",
|
||||
"cosmjs-types": "^0.1.0",
|
||||
"cosmjs-types": "^0.2.0",
|
||||
"long": "^4.0.0",
|
||||
"protobufjs": "~6.10.2"
|
||||
},
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
"@cosmjs/stream": "workspace:packages/stream",
|
||||
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
||||
"@cosmjs/utils": "workspace:packages/utils",
|
||||
"cosmjs-types": "^0.1.0",
|
||||
"cosmjs-types": "^0.2.0",
|
||||
"long": "^4.0.0",
|
||||
"protobufjs": "~6.10.2",
|
||||
"xstream": "^11.14.0"
|
||||
|
||||
@ -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
|
||||
|
||||
BIN
scripts/wasmd/contracts/cw1_subkeys.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/cw1_subkeys.wasm
(Stored with Git LFS)
Binary file not shown.
BIN
scripts/wasmd/contracts/cw3_fixed_multisig.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/cw3_fixed_multisig.wasm
(Stored with Git LFS)
Binary file not shown.
@ -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"
|
||||
|
||||
BIN
scripts/wasmd/contracts/hackatom.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/hackatom.wasm
(Stored with Git LFS)
Binary file not shown.
BIN
scripts/wasmd/contracts/ibc_reflect.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/ibc_reflect.wasm
(Stored with Git LFS)
Binary file not shown.
@ -16,11 +16,6 @@ const alice = {
|
||||
// address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/cw1-subkeys/0.3.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.4",
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const gasPrice = GasPrice.fromString("0.025ucosm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
@ -32,7 +27,6 @@ async function main() {
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
codeMeta,
|
||||
"Upload CW1 subkeys contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
@ -16,11 +16,6 @@ const alice = {
|
||||
address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/cw3-fixed-multisig/0.3.1/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.4",
|
||||
};
|
||||
|
||||
const initData = [
|
||||
{
|
||||
admin: alice.address0,
|
||||
@ -74,7 +69,6 @@ async function main() {
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
codeMeta,
|
||||
"Upload CW3 fixed multisig contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
@ -16,11 +16,6 @@ const alice = {
|
||||
address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/hackatom/not-yet-released/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.8",
|
||||
};
|
||||
|
||||
const inits = [
|
||||
{
|
||||
label: "From deploy_hackatom.js (0)",
|
||||
@ -59,7 +54,6 @@ async function main() {
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
codeMeta,
|
||||
"Upload hackatom contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
@ -16,11 +16,6 @@ const alice = {
|
||||
address4: "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
};
|
||||
|
||||
const codeMeta = {
|
||||
source: "https://crates.io/api/v1/crates/hackatom/not-yet-released/download",
|
||||
builder: "cosmwasm/rust-optimizer:0.10.8",
|
||||
};
|
||||
|
||||
const inits = [
|
||||
{
|
||||
label: "Instantiate IBC reflect",
|
||||
@ -42,7 +37,6 @@ async function main() {
|
||||
alice.address0,
|
||||
wasm,
|
||||
uploadFee,
|
||||
codeMeta,
|
||||
"Upload IBC reflect contract",
|
||||
);
|
||||
console.info(`Upload succeeded. Receipt: ${JSON.stringify(uploadReceipt)}`);
|
||||
|
||||
@ -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"
|
||||
|
||||
16
yarn.lock
16
yarn.lock
@ -367,7 +367,7 @@ __metadata:
|
||||
axios: ^0.21.1
|
||||
babylon: ^6.18.0
|
||||
colors: ^1.3.3
|
||||
cosmjs-types: ^0.1.0
|
||||
cosmjs-types: ^0.2.0
|
||||
diff: ^4
|
||||
eslint: ^7.5
|
||||
eslint-config-prettier: ^8.3.0
|
||||
@ -413,7 +413,7 @@ __metadata:
|
||||
"@types/pako": ^1.0.1
|
||||
"@typescript-eslint/eslint-plugin": ^4.28
|
||||
"@typescript-eslint/parser": ^4.28
|
||||
cosmjs-types: ^0.1.0
|
||||
cosmjs-types: ^0.2.0
|
||||
eslint: ^7.5
|
||||
eslint-config-prettier: ^8.3.0
|
||||
eslint-import-resolver-node: ^0.3.4
|
||||
@ -835,7 +835,7 @@ __metadata:
|
||||
"@types/node": ^15.0.1
|
||||
"@typescript-eslint/eslint-plugin": ^4.28
|
||||
"@typescript-eslint/parser": ^4.28
|
||||
cosmjs-types: ^0.1.0
|
||||
cosmjs-types: ^0.2.0
|
||||
eslint: ^7.5
|
||||
eslint-config-prettier: ^8.3.0
|
||||
eslint-import-resolver-node: ^0.3.4
|
||||
@ -935,7 +935,7 @@ __metadata:
|
||||
"@types/node": ^15.0.1
|
||||
"@typescript-eslint/eslint-plugin": ^4.28
|
||||
"@typescript-eslint/parser": ^4.28
|
||||
cosmjs-types: ^0.1.0
|
||||
cosmjs-types: ^0.2.0
|
||||
eslint: ^7.5
|
||||
eslint-config-prettier: ^8.3.0
|
||||
eslint-import-resolver-node: ^0.3.4
|
||||
@ -3011,13 +3011,13 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"cosmjs-types@npm:^0.1.0":
|
||||
version: 0.1.0
|
||||
resolution: "cosmjs-types@npm:0.1.0"
|
||||
"cosmjs-types@npm:^0.2.0":
|
||||
version: 0.2.0
|
||||
resolution: "cosmjs-types@npm:0.2.0"
|
||||
dependencies:
|
||||
long: ^4.0.0
|
||||
protobufjs: ~6.11.2
|
||||
checksum: ca08e65750a686da3b96b944601d4bdef5f8860ee7695b891edd693ae4ebcd58af84fc49c9b085fa20318ce4ac4bf8b580e1f4a1f40692697c2e52ad1c617490
|
||||
checksum: 2c3215a9a28b5ac8d90dbd01c1f66bd3d271fe020f30165a4802f890af91ec15ca65e46b8c8c03c57451b4dcb0fa932cd5c1febcc5c9173f71ff427bcae39d20
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user