mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Adapt cosmwasm code to wasmd 0.10
This commit is contained in:
parent
c9283db741
commit
b92405108a
@ -58,6 +58,7 @@ async function uploadContract(
|
||||
wasm_byte_code: toBase64(contract.data),
|
||||
source: contract.source || "",
|
||||
builder: contract.builder || "",
|
||||
instantiate_permission: null,
|
||||
},
|
||||
};
|
||||
const fee: StdFee = {
|
||||
@ -413,9 +414,6 @@ describe("wasm", () => {
|
||||
jasmine.objectContaining({
|
||||
code_id: codeId,
|
||||
creator: alice.address0,
|
||||
init_msg: jasmine.objectContaining({
|
||||
beneficiary: beneficiaryAddress,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(myInfo.admin).toBeUndefined();
|
||||
@ -455,16 +453,14 @@ describe("wasm", () => {
|
||||
// check out history
|
||||
const myHistory = await client.wasm.getContractCodeHistory(myAddress);
|
||||
assert(myHistory);
|
||||
expect(myHistory).toEqual(
|
||||
jasmine.objectContaining({
|
||||
codeId: codeId,
|
||||
operation: "Init",
|
||||
msg: {
|
||||
verifier: alice.address0,
|
||||
beneficiary: beneficiaryAddress,
|
||||
},
|
||||
}),
|
||||
);
|
||||
expect(myHistory).toContain({
|
||||
code_id: codeId,
|
||||
operation: "Init",
|
||||
msg: {
|
||||
verifier: alice.address0,
|
||||
beneficiary: beneficiaryAddress,
|
||||
},
|
||||
});
|
||||
// make sure random addresses don't give useful info
|
||||
const nonExistentAddress = makeRandomAddress();
|
||||
expect(await client.wasm.getContractCodeHistory(nonExistentAddress)).toBeNull();
|
||||
|
@ -1,11 +1,17 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Coin, Msg } from "@cosmjs/sdk38";
|
||||
|
||||
// TODO: implement
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/params.go#L68-L71
|
||||
*/
|
||||
export type AccessConfig = never;
|
||||
|
||||
/**
|
||||
* Uploads Wasm code to the chain.
|
||||
* A numeric, auto-incrementing code ID will be generated as a result of the execution of this message.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L34
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/msg.go#L10-L20
|
||||
*/
|
||||
export interface MsgStoreCode extends Msg {
|
||||
readonly type: "wasm/MsgStoreCode";
|
||||
@ -18,6 +24,7 @@ export interface MsgStoreCode extends Msg {
|
||||
readonly source: string;
|
||||
/** A docker tag. Can be empty. */
|
||||
readonly builder: string;
|
||||
readonly instantiate_permission: AccessConfig | null;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -214,6 +214,7 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
||||
wasm_byte_code: toBase64(compressed),
|
||||
source: source,
|
||||
builder: builder,
|
||||
instantiate_permission: null,
|
||||
},
|
||||
};
|
||||
const result = await this.signAndPost([storeCodeMsg], this.fees.upload, memo);
|
||||
|
7
packages/cosmwasm/types/msgs.d.ts
vendored
7
packages/cosmwasm/types/msgs.d.ts
vendored
@ -1,9 +1,13 @@
|
||||
import { Coin, Msg } from "@cosmjs/sdk38";
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/params.go#L68-L71
|
||||
*/
|
||||
export declare type AccessConfig = never;
|
||||
/**
|
||||
* Uploads Wasm code to the chain.
|
||||
* A numeric, auto-incrementing code ID will be generated as a result of the execution of this message.
|
||||
*
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.9.0-alpha4/x/wasm/internal/types/msg.go#L34
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.10.0-alpha/x/wasm/internal/types/msg.go#L10-L20
|
||||
*/
|
||||
export interface MsgStoreCode extends Msg {
|
||||
readonly type: "wasm/MsgStoreCode";
|
||||
@ -16,6 +20,7 @@ export interface MsgStoreCode extends Msg {
|
||||
readonly source: string;
|
||||
/** A docker tag. Can be empty. */
|
||||
readonly builder: string;
|
||||
readonly instantiate_permission: AccessConfig | null;
|
||||
};
|
||||
}
|
||||
export declare function isMsgStoreCode(msg: Msg): msg is MsgStoreCode;
|
||||
|
Loading…
x
Reference in New Issue
Block a user