Merge pull request #781 from cosmos/wasmd-0.16-support
Wasmd 0.16 support
This commit is contained in:
commit
ff92184884
@ -19,8 +19,8 @@ Updating Hackatom development contract in `src/testdata/contract.json`:
|
||||
|
||||
```sh
|
||||
cd packages/cosmwasm-launchpad
|
||||
export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm-launchpad/releases/download/v0.11.0-alpha4/hackatom.wasm
|
||||
echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64)\" }" | jq > src/testdata/contract.json
|
||||
export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm/releases/download/v0.11.0-alpha4/hackatom.wasm
|
||||
echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64 | tr -d '[:space:]')\" }" | jq > src/testdata/contract.json
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
@ -17,8 +17,8 @@ Updating Hackatom development contract in `src/testdata/contract.json`:
|
||||
|
||||
```sh
|
||||
cd packages/cosmwasm-stargate
|
||||
export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm/releases/download/v0.12.0/hackatom.wasm
|
||||
echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64)\" }" | jq > src/testdata/contract.json
|
||||
export HACKATOM_URL=https://github.com/CosmWasm/cosmwasm/releases/download/v0.14.0-beta5/hackatom.wasm
|
||||
echo "{\"// source\": \"$HACKATOM_URL\", \"data\": \"$(curl -sS --location $HACKATOM_URL | base64 | tr -d '[:space:]')\" }" | jq > src/testdata/contract.json
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
@ -37,7 +37,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.16.0-alpha1 COSMOS_SDK_REF=v0.42.0 ./scripts/get-proto.sh",
|
||||
"get-proto": "WASM_REF=v0.16.0-alpha2 COSMOS_SDK_REF=v0.42.4 ./scripts/get-proto.sh",
|
||||
"define-proto": "./scripts/define-proto.sh",
|
||||
"postdefine-proto": "prettier --write \"src/codec/**/*.ts\""
|
||||
},
|
||||
|
||||
@ -5,7 +5,7 @@ command -v shellcheck >/dev/null && shellcheck "$0"
|
||||
ROOT_PROTO_DIR="./proto"
|
||||
COSMOS_PROTO_DIR="$ROOT_PROTO_DIR/cosmos/cosmos-sdk/proto"
|
||||
THIRD_PARTY_PROTO_DIR="$ROOT_PROTO_DIR/cosmos/cosmos-sdk/third_party/proto"
|
||||
WASMD_PROTO_DIR="$ROOT_PROTO_DIR/cosmwasm/wasmd"
|
||||
WASMD_PROTO_DIR="$ROOT_PROTO_DIR/cosmwasm/wasmd/proto"
|
||||
OUT_DIR="./src/codec/"
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
@ -17,13 +17,15 @@ protoc \
|
||||
--proto_path="$THIRD_PARTY_PROTO_DIR" \
|
||||
--proto_path="$WASMD_PROTO_DIR" \
|
||||
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
|
||||
"$WASMD_PROTO_DIR/x/wasm/internal/types/types.proto" \
|
||||
"$WASMD_PROTO_DIR/x/wasm/internal/types/query.proto" \
|
||||
"$WASMD_PROTO_DIR/x/wasm/internal/types/tx.proto" \
|
||||
"$WASMD_PROTO_DIR/cosmwasm/wasm/v1beta1/types.proto" \
|
||||
"$WASMD_PROTO_DIR/cosmwasm/wasm/v1beta1/query.proto" \
|
||||
"$WASMD_PROTO_DIR/cosmwasm/wasm/v1beta1/tx.proto" \
|
||||
"$COSMOS_PROTO_DIR/cosmos/base/v1beta1/coin.proto" \
|
||||
"$COSMOS_PROTO_DIR/cosmos/base/query/v1beta1/pagination.proto"
|
||||
|
||||
# Remove unnecessary codec files
|
||||
rm -rf \
|
||||
src/codec/cosmos_proto/ \
|
||||
src/codec/gogoproto/ \
|
||||
src/codec/google/
|
||||
src/codec/google/api/ \
|
||||
src/codec/google/protobuf/descriptor.ts
|
||||
|
||||
@ -19,7 +19,7 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "./codec/x/wasm/internal/types/tx";
|
||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
||||
|
||||
describe("AminoTypes", () => {
|
||||
describe("toAmino", () => {
|
||||
|
||||
@ -10,17 +10,17 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "./codec/x/wasm/internal/types/tx";
|
||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
||||
|
||||
// TODO: implement
|
||||
/**
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/types.proto#L30-L35
|
||||
* @see https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/types.proto#L30-L35
|
||||
*/
|
||||
type AccessConfig = never;
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L28-L40
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L28-L40
|
||||
*/
|
||||
export interface AminoMsgStoreCode {
|
||||
type: "wasm/MsgStoreCode";
|
||||
@ -39,7 +39,7 @@ export interface AminoMsgStoreCode {
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L70-L80
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L70-L80
|
||||
*/
|
||||
export interface AminoMsgExecuteContract {
|
||||
type: "wasm/MsgExecuteContract";
|
||||
@ -56,7 +56,7 @@ export interface AminoMsgExecuteContract {
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L47-L61
|
||||
*/
|
||||
export interface AminoMsgInstantiateContract {
|
||||
type: "wasm/MsgInstantiateContract";
|
||||
@ -77,7 +77,7 @@ export interface AminoMsgInstantiateContract {
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L88-L98
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L88-L98
|
||||
*/
|
||||
export interface AminoMsgMigrateContract {
|
||||
type: "wasm/MsgMigrateContract";
|
||||
@ -95,7 +95,7 @@ export interface AminoMsgMigrateContract {
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L107-L115
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L107-L115
|
||||
*/
|
||||
export interface AminoMsgUpdateAdmin {
|
||||
type: "wasm/MsgUpdateAdmin";
|
||||
@ -111,7 +111,7 @@ export interface AminoMsgUpdateAdmin {
|
||||
|
||||
/**
|
||||
* The Amino JSON representation of
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L120-L126
|
||||
* https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha2/proto/cosmwasm/wasm/v1beta1/tx.proto#L120-L126
|
||||
*/
|
||||
export interface AminoMsgClearAdmin {
|
||||
type: "wasm/MsgClearAdmin";
|
||||
|
||||
@ -1,25 +1,34 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../../x/wasm/internal/types/types";
|
||||
import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination";
|
||||
import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../cosmwasm/wasm/v1beta1/types";
|
||||
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
|
||||
|
||||
export const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
|
||||
/** QueryContractInfoRequest is the request type for the Query/ContractInfo RPC method */
|
||||
/**
|
||||
* QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
|
||||
* method
|
||||
*/
|
||||
export interface QueryContractInfoRequest {
|
||||
/** address is the address of the contract to query */
|
||||
address: string;
|
||||
}
|
||||
|
||||
/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */
|
||||
/**
|
||||
* QueryContractInfoResponse is the response type for the Query/ContractInfo RPC
|
||||
* method
|
||||
*/
|
||||
export interface QueryContractInfoResponse {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
contractInfo?: ContractInfo;
|
||||
}
|
||||
|
||||
/** QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method */
|
||||
/**
|
||||
* QueryContractHistoryRequest is the request type for the Query/ContractHistory
|
||||
* RPC method
|
||||
*/
|
||||
export interface QueryContractHistoryRequest {
|
||||
/** address is the address of the contract to query */
|
||||
address: string;
|
||||
@ -27,14 +36,20 @@ export interface QueryContractHistoryRequest {
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
|
||||
/** QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method */
|
||||
/**
|
||||
* QueryContractHistoryResponse is the response type for the
|
||||
* Query/ContractHistory RPC method
|
||||
*/
|
||||
export interface QueryContractHistoryResponse {
|
||||
entries: ContractCodeHistoryEntry[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method */
|
||||
/**
|
||||
* QueryContractsByCodeRequest is the request type for the Query/ContractsByCode
|
||||
* RPC method
|
||||
*/
|
||||
export interface QueryContractsByCodeRequest {
|
||||
/** grpc-gateway_out does not support Go style CodID */
|
||||
codeId: Long;
|
||||
@ -42,20 +57,21 @@ export interface QueryContractsByCodeRequest {
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
|
||||
/** ContractInfoWithAddress adds the address (key) to the ContractInfo representation */
|
||||
export interface ContractInfoWithAddress {
|
||||
address: string;
|
||||
contractInfo?: ContractInfo;
|
||||
}
|
||||
|
||||
/** QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method */
|
||||
/**
|
||||
* QueryContractsByCodeResponse is the response type for the
|
||||
* Query/ContractsByCode RPC method
|
||||
*/
|
||||
export interface QueryContractsByCodeResponse {
|
||||
contractInfos: ContractInfoWithAddress[];
|
||||
/** contracts are a set of contract addresses */
|
||||
contracts: string[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method */
|
||||
/**
|
||||
* QueryAllContractStateRequest is the request type for the
|
||||
* Query/AllContractState RPC method
|
||||
*/
|
||||
export interface QueryAllContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
@ -63,27 +79,39 @@ export interface QueryAllContractStateRequest {
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
|
||||
/** QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method */
|
||||
/**
|
||||
* QueryAllContractStateResponse is the response type for the
|
||||
* Query/AllContractState RPC method
|
||||
*/
|
||||
export interface QueryAllContractStateResponse {
|
||||
models: Model[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method */
|
||||
/**
|
||||
* QueryRawContractStateRequest is the request type for the
|
||||
* Query/RawContractState RPC method
|
||||
*/
|
||||
export interface QueryRawContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
queryData: Uint8Array;
|
||||
}
|
||||
|
||||
/** QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method */
|
||||
/**
|
||||
* QueryRawContractStateResponse is the response type for the
|
||||
* Query/RawContractState RPC method
|
||||
*/
|
||||
export interface QueryRawContractStateResponse {
|
||||
/** Data contains the raw store data */
|
||||
data: Uint8Array;
|
||||
}
|
||||
|
||||
/** QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method */
|
||||
/**
|
||||
* QuerySmartContractStateRequest is the request type for the
|
||||
* Query/SmartContractState RPC method
|
||||
*/
|
||||
export interface QuerySmartContractStateRequest {
|
||||
/** address is the address of the contract */
|
||||
address: string;
|
||||
@ -91,7 +119,10 @@ export interface QuerySmartContractStateRequest {
|
||||
queryData: Uint8Array;
|
||||
}
|
||||
|
||||
/** QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method */
|
||||
/**
|
||||
* QuerySmartContractStateResponse is the response type for the
|
||||
* Query/SmartContractState RPC method
|
||||
*/
|
||||
export interface QuerySmartContractStateResponse {
|
||||
/** Data contains the json data returned from the smart contract */
|
||||
data: Uint8Array;
|
||||
@ -486,85 +517,12 @@ export const QueryContractsByCodeRequest = {
|
||||
},
|
||||
};
|
||||
|
||||
const baseContractInfoWithAddress: object = { address: "" };
|
||||
|
||||
export const ContractInfoWithAddress = {
|
||||
encode(message: ContractInfoWithAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.address !== "") {
|
||||
writer.uint32(10).string(message.address);
|
||||
}
|
||||
if (message.contractInfo !== undefined) {
|
||||
ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfoWithAddress {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress;
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.address = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.contractInfo = ContractInfo.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ContractInfoWithAddress {
|
||||
const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress;
|
||||
if (object.address !== undefined && object.address !== null) {
|
||||
message.address = String(object.address);
|
||||
} else {
|
||||
message.address = "";
|
||||
}
|
||||
if (object.contractInfo !== undefined && object.contractInfo !== null) {
|
||||
message.contractInfo = ContractInfo.fromJSON(object.contractInfo);
|
||||
} else {
|
||||
message.contractInfo = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: ContractInfoWithAddress): unknown {
|
||||
const obj: any = {};
|
||||
message.address !== undefined && (obj.address = message.address);
|
||||
message.contractInfo !== undefined &&
|
||||
(obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<ContractInfoWithAddress>): ContractInfoWithAddress {
|
||||
const message = { ...baseContractInfoWithAddress } as ContractInfoWithAddress;
|
||||
if (object.address !== undefined && object.address !== null) {
|
||||
message.address = object.address;
|
||||
} else {
|
||||
message.address = "";
|
||||
}
|
||||
if (object.contractInfo !== undefined && object.contractInfo !== null) {
|
||||
message.contractInfo = ContractInfo.fromPartial(object.contractInfo);
|
||||
} else {
|
||||
message.contractInfo = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
const baseQueryContractsByCodeResponse: object = {};
|
||||
const baseQueryContractsByCodeResponse: object = { contracts: "" };
|
||||
|
||||
export const QueryContractsByCodeResponse = {
|
||||
encode(message: QueryContractsByCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.contractInfos) {
|
||||
ContractInfoWithAddress.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
for (const v of message.contracts) {
|
||||
writer.uint32(10).string(v!);
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
||||
@ -576,12 +534,12 @@ export const QueryContractsByCodeResponse = {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse;
|
||||
message.contractInfos = [];
|
||||
message.contracts = [];
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.contractInfos.push(ContractInfoWithAddress.decode(reader, reader.uint32()));
|
||||
message.contracts.push(reader.string());
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
@ -596,10 +554,10 @@ export const QueryContractsByCodeResponse = {
|
||||
|
||||
fromJSON(object: any): QueryContractsByCodeResponse {
|
||||
const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse;
|
||||
message.contractInfos = [];
|
||||
if (object.contractInfos !== undefined && object.contractInfos !== null) {
|
||||
for (const e of object.contractInfos) {
|
||||
message.contractInfos.push(ContractInfoWithAddress.fromJSON(e));
|
||||
message.contracts = [];
|
||||
if (object.contracts !== undefined && object.contracts !== null) {
|
||||
for (const e of object.contracts) {
|
||||
message.contracts.push(String(e));
|
||||
}
|
||||
}
|
||||
if (object.pagination !== undefined && object.pagination !== null) {
|
||||
@ -612,12 +570,10 @@ export const QueryContractsByCodeResponse = {
|
||||
|
||||
toJSON(message: QueryContractsByCodeResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.contractInfos) {
|
||||
obj.contractInfos = message.contractInfos.map((e) =>
|
||||
e ? ContractInfoWithAddress.toJSON(e) : undefined,
|
||||
);
|
||||
if (message.contracts) {
|
||||
obj.contracts = message.contracts.map((e) => e);
|
||||
} else {
|
||||
obj.contractInfos = [];
|
||||
obj.contracts = [];
|
||||
}
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
|
||||
@ -626,10 +582,10 @@ export const QueryContractsByCodeResponse = {
|
||||
|
||||
fromPartial(object: DeepPartial<QueryContractsByCodeResponse>): QueryContractsByCodeResponse {
|
||||
const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse;
|
||||
message.contractInfos = [];
|
||||
if (object.contractInfos !== undefined && object.contractInfos !== null) {
|
||||
for (const e of object.contractInfos) {
|
||||
message.contractInfos.push(ContractInfoWithAddress.fromPartial(e));
|
||||
message.contracts = [];
|
||||
if (object.contracts !== undefined && object.contracts !== null) {
|
||||
for (const e of object.contracts) {
|
||||
message.contracts.push(e);
|
||||
}
|
||||
}
|
||||
if (object.pagination !== undefined && object.pagination !== null) {
|
||||
@ -1,8 +1,8 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { AccessConfig } from "../../../../x/wasm/internal/types/types";
|
||||
import { Coin } from "../../../../cosmos/base/v1beta1/coin";
|
||||
import { AccessConfig } from "../../../cosmwasm/wasm/v1beta1/types";
|
||||
import { Coin } from "../../../cosmos/base/v1beta1/coin";
|
||||
|
||||
export const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
|
||||
@ -12,11 +12,17 @@ export interface MsgStoreCode {
|
||||
sender: string;
|
||||
/** WASMByteCode can be raw or gzip compressed */
|
||||
wasmByteCode: Uint8Array;
|
||||
/** Source is a valid absolute HTTPS URI to the contract's source code, optional */
|
||||
/**
|
||||
* Source is a valid absolute HTTPS URI to the contract's source code,
|
||||
* optional
|
||||
*/
|
||||
source: string;
|
||||
/** Builder is a valid docker image name with tag, optional */
|
||||
builder: string;
|
||||
/** InstantiatePermission access control to apply on contract creation, optional */
|
||||
/**
|
||||
* InstantiatePermission access control to apply on contract creation,
|
||||
* optional
|
||||
*/
|
||||
instantiatePermission?: AccessConfig;
|
||||
}
|
||||
|
||||
@ -26,7 +32,10 @@ export interface MsgStoreCodeResponse {
|
||||
codeId: Long;
|
||||
}
|
||||
|
||||
/** MsgInstantiateContract create a new smart contract instance for the given code id. */
|
||||
/**
|
||||
* MsgInstantiateContract create a new smart contract instance for the given
|
||||
* code id.
|
||||
*/
|
||||
export interface MsgInstantiateContract {
|
||||
/** Sender is the that actor that signed the messages */
|
||||
sender: string;
|
||||
@ -1,6 +1,7 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { Any } from "../../../google/protobuf/any";
|
||||
|
||||
export const protobufPackage = "cosmwasm.wasm.v1beta1";
|
||||
|
||||
@ -126,7 +127,10 @@ export interface CodeInfo {
|
||||
codeHash: Uint8Array;
|
||||
/** Creator address who initially stored the code */
|
||||
creator: string;
|
||||
/** Source is a valid absolute HTTPS URI to the contract's source code, optional */
|
||||
/**
|
||||
* Source is a valid absolute HTTPS URI to the contract's source code,
|
||||
* optional
|
||||
*/
|
||||
source: string;
|
||||
/** Builder is a valid docker image name with tag, optional */
|
||||
builder: string;
|
||||
@ -146,10 +150,16 @@ export interface ContractInfo {
|
||||
label: string;
|
||||
/**
|
||||
* Created Tx position when the contract was instantiated.
|
||||
* This data should kept internal and not be exposed via query results. Just use for sorting
|
||||
* This data should kept internal and not be exposed via query results. Just
|
||||
* use for sorting
|
||||
*/
|
||||
created?: AbsoluteTxPosition;
|
||||
ibcPortId: string;
|
||||
/**
|
||||
* Extension is an extension point to store custom metadata within the
|
||||
* persistence model.
|
||||
*/
|
||||
extension?: Any;
|
||||
}
|
||||
|
||||
/** ContractCodeHistoryEntry metadata to a contract. */
|
||||
@ -162,11 +172,17 @@ export interface ContractCodeHistoryEntry {
|
||||
msg: Uint8Array;
|
||||
}
|
||||
|
||||
/** AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions. */
|
||||
/**
|
||||
* AbsoluteTxPosition is a unique transaction position that allows for global
|
||||
* ordering of transactions.
|
||||
*/
|
||||
export interface AbsoluteTxPosition {
|
||||
/** BlockHeight is the block the contract was created at */
|
||||
blockHeight: Long;
|
||||
/** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */
|
||||
/**
|
||||
* TxIndex is a monotonic counter within the block (actual transaction index,
|
||||
* or gas consumed)
|
||||
*/
|
||||
txIndex: Long;
|
||||
}
|
||||
|
||||
@ -548,6 +564,9 @@ export const ContractInfo = {
|
||||
if (message.ibcPortId !== "") {
|
||||
writer.uint32(50).string(message.ibcPortId);
|
||||
}
|
||||
if (message.extension !== undefined) {
|
||||
Any.encode(message.extension, writer.uint32(58).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
@ -576,6 +595,9 @@ export const ContractInfo = {
|
||||
case 6:
|
||||
message.ibcPortId = reader.string();
|
||||
break;
|
||||
case 7:
|
||||
message.extension = Any.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@ -616,6 +638,11 @@ export const ContractInfo = {
|
||||
} else {
|
||||
message.ibcPortId = "";
|
||||
}
|
||||
if (object.extension !== undefined && object.extension !== null) {
|
||||
message.extension = Any.fromJSON(object.extension);
|
||||
} else {
|
||||
message.extension = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
@ -628,6 +655,8 @@ export const ContractInfo = {
|
||||
message.created !== undefined &&
|
||||
(obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined);
|
||||
message.ibcPortId !== undefined && (obj.ibcPortId = message.ibcPortId);
|
||||
message.extension !== undefined &&
|
||||
(obj.extension = message.extension ? Any.toJSON(message.extension) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
@ -663,6 +692,11 @@ export const ContractInfo = {
|
||||
} else {
|
||||
message.ibcPortId = "";
|
||||
}
|
||||
if (object.extension !== undefined && object.extension !== null) {
|
||||
message.extension = Any.fromPartial(object.extension);
|
||||
} else {
|
||||
message.extension = undefined;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
241
packages/cosmwasm-stargate/src/codec/google/protobuf/any.ts
Normal file
241
packages/cosmwasm-stargate/src/codec/google/protobuf/any.ts
Normal file
@ -0,0 +1,241 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||
* URL that describes the type of the serialized message.
|
||||
*
|
||||
* Protobuf library provides support to pack/unpack Any values in the form
|
||||
* of utility functions or additional generated methods of the Any type.
|
||||
*
|
||||
* Example 1: Pack and unpack a message in C++.
|
||||
*
|
||||
* Foo foo = ...;
|
||||
* Any any;
|
||||
* any.PackFrom(foo);
|
||||
* ...
|
||||
* if (any.UnpackTo(&foo)) {
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* Example 2: Pack and unpack a message in Java.
|
||||
*
|
||||
* Foo foo = ...;
|
||||
* Any any = Any.pack(foo);
|
||||
* ...
|
||||
* if (any.is(Foo.class)) {
|
||||
* foo = any.unpack(Foo.class);
|
||||
* }
|
||||
*
|
||||
* Example 3: Pack and unpack a message in Python.
|
||||
*
|
||||
* foo = Foo(...)
|
||||
* any = Any()
|
||||
* any.Pack(foo)
|
||||
* ...
|
||||
* if any.Is(Foo.DESCRIPTOR):
|
||||
* any.Unpack(foo)
|
||||
* ...
|
||||
*
|
||||
* Example 4: Pack and unpack a message in Go
|
||||
*
|
||||
* foo := &pb.Foo{...}
|
||||
* any, err := ptypes.MarshalAny(foo)
|
||||
* ...
|
||||
* foo := &pb.Foo{}
|
||||
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* The pack methods provided by protobuf library will by default use
|
||||
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
||||
* methods only use the fully qualified type name after the last '/'
|
||||
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
||||
* name "y.z".
|
||||
*
|
||||
*
|
||||
* JSON
|
||||
* ====
|
||||
* The JSON representation of an `Any` value uses the regular
|
||||
* representation of the deserialized, embedded message, with an
|
||||
* additional field `@type` which contains the type URL. Example:
|
||||
*
|
||||
* package google.profile;
|
||||
* message Person {
|
||||
* string first_name = 1;
|
||||
* string last_name = 2;
|
||||
* }
|
||||
*
|
||||
* {
|
||||
* "@type": "type.googleapis.com/google.profile.Person",
|
||||
* "firstName": <string>,
|
||||
* "lastName": <string>
|
||||
* }
|
||||
*
|
||||
* If the embedded message type is well-known and has a custom JSON
|
||||
* representation, that representation will be embedded adding a field
|
||||
* `value` which holds the custom JSON in addition to the `@type`
|
||||
* field. Example (for message [google.protobuf.Duration][]):
|
||||
*
|
||||
* {
|
||||
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
||||
* "value": "1.212s"
|
||||
* }
|
||||
*/
|
||||
export interface Any {
|
||||
/**
|
||||
* A URL/resource name that uniquely identifies the type of the serialized
|
||||
* protocol buffer message. This string must contain at least
|
||||
* one "/" character. The last segment of the URL's path must represent
|
||||
* the fully qualified name of the type (as in
|
||||
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
||||
* (e.g., leading "." is not accepted).
|
||||
*
|
||||
* In practice, teams usually precompile into the binary all types that they
|
||||
* expect it to use in the context of Any. However, for URLs which use the
|
||||
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||
* server that maps type URLs to message definitions as follows:
|
||||
*
|
||||
* * If no scheme is provided, `https` is assumed.
|
||||
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
* value in binary format, or produce an error.
|
||||
* * Applications are allowed to cache lookup results based on the
|
||||
* URL, or have them precompiled into a binary to avoid any
|
||||
* lookup. Therefore, binary compatibility needs to be preserved
|
||||
* on changes to types. (Use versioned type names to manage
|
||||
* breaking changes.)
|
||||
*
|
||||
* Note: this functionality is not currently available in the official
|
||||
* protobuf release, and it is not used for type URLs beginning with
|
||||
* type.googleapis.com.
|
||||
*
|
||||
* Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
* used with implementation specific semantics.
|
||||
*/
|
||||
typeUrl: string;
|
||||
/** Must be a valid serialized protocol buffer of the above specified type. */
|
||||
value: Uint8Array;
|
||||
}
|
||||
|
||||
const baseAny: object = { typeUrl: "" };
|
||||
|
||||
export const Any = {
|
||||
encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.typeUrl !== "") {
|
||||
writer.uint32(10).string(message.typeUrl);
|
||||
}
|
||||
if (message.value.length !== 0) {
|
||||
writer.uint32(18).bytes(message.value);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Any {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = { ...baseAny } as Any;
|
||||
message.value = new Uint8Array();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.typeUrl = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.value = reader.bytes();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Any {
|
||||
const message = { ...baseAny } as Any;
|
||||
message.value = new Uint8Array();
|
||||
if (object.typeUrl !== undefined && object.typeUrl !== null) {
|
||||
message.typeUrl = String(object.typeUrl);
|
||||
} else {
|
||||
message.typeUrl = "";
|
||||
}
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = bytesFromBase64(object.value);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
toJSON(message: Any): unknown {
|
||||
const obj: any = {};
|
||||
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
|
||||
message.value !== undefined &&
|
||||
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Any>): Any {
|
||||
const message = { ...baseAny } as Any;
|
||||
if (object.typeUrl !== undefined && object.typeUrl !== null) {
|
||||
message.typeUrl = object.typeUrl;
|
||||
} else {
|
||||
message.typeUrl = "";
|
||||
}
|
||||
if (object.value !== undefined && object.value !== null) {
|
||||
message.value = object.value;
|
||||
} else {
|
||||
message.value = new Uint8Array();
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
const atob: (b64: string) => string =
|
||||
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
const bin = atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
const btoa: (bin: string) => string =
|
||||
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
const bin: string[] = [];
|
||||
for (let i = 0; i < arr.byteLength; ++i) {
|
||||
bin.push(String.fromCharCode(arr[i]));
|
||||
}
|
||||
return btoa(bin.join(""));
|
||||
}
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { Code } from "@cosmjs/cosmwasm-launchpad";
|
||||
import { sha256 } from "@cosmjs/crypto";
|
||||
import { Bech32, fromAscii, fromBase64, fromHex, toAscii, toBase64 } from "@cosmjs/encoding";
|
||||
import { fromAscii, fromBase64, fromHex, toAscii } from "@cosmjs/encoding";
|
||||
import { Int53 } from "@cosmjs/math";
|
||||
import {
|
||||
DirectSecp256k1HdWallet,
|
||||
@ -274,29 +274,8 @@ describe("CosmWasmClient", () => {
|
||||
pendingWithoutWasmd();
|
||||
const client = await CosmWasmClient.connect(wasmd.endpoint);
|
||||
const result = await client.getContracts(1);
|
||||
expect(result.length).toBeGreaterThanOrEqual(3);
|
||||
const [zero, one, two] = result;
|
||||
expect(zero).toEqual({
|
||||
address: deployedHackatom.instances[0].address,
|
||||
codeId: deployedHackatom.codeId,
|
||||
creator: alice.address0,
|
||||
admin: undefined,
|
||||
label: deployedHackatom.instances[0].label,
|
||||
});
|
||||
expect(one).toEqual({
|
||||
address: deployedHackatom.instances[1].address,
|
||||
codeId: deployedHackatom.codeId,
|
||||
creator: alice.address0,
|
||||
admin: undefined,
|
||||
label: deployedHackatom.instances[1].label,
|
||||
});
|
||||
expect(two).toEqual({
|
||||
address: deployedHackatom.instances[2].address,
|
||||
codeId: deployedHackatom.codeId,
|
||||
creator: alice.address0,
|
||||
admin: alice.address1,
|
||||
label: deployedHackatom.instances[2].label,
|
||||
});
|
||||
const expectedAddresses = deployedHackatom.instances.map((info) => info.address);
|
||||
expect(result).toEqual(expectedAddresses);
|
||||
});
|
||||
});
|
||||
|
||||
@ -359,9 +338,9 @@ describe("CosmWasmClient", () => {
|
||||
const raw = await client.queryContractRaw(contract.address, configKey);
|
||||
assert(raw, "must get result");
|
||||
expect(JSON.parse(fromAscii(raw))).toEqual({
|
||||
verifier: toBase64(Bech32.decode(contract.initMsg.verifier).data),
|
||||
beneficiary: toBase64(Bech32.decode(contract.initMsg.beneficiary).data),
|
||||
funder: toBase64(Bech32.decode(alice.address0).data),
|
||||
verifier: contract.initMsg.verifier,
|
||||
beneficiary: contract.initMsg.beneficiary,
|
||||
funder: alice.address0,
|
||||
});
|
||||
});
|
||||
|
||||
@ -420,7 +399,7 @@ describe("CosmWasmClient", () => {
|
||||
|
||||
const client = await CosmWasmClient.connect(wasmd.endpoint);
|
||||
await expectAsync(client.queryContractSmart(contract.address, { broken: {} })).toBeRejectedWithError(
|
||||
/Error parsing into type hackatom::contract::QueryMsg: unknown variant/i,
|
||||
/Error parsing into type hackatom::msg::QueryMsg: unknown variant/i,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -31,8 +31,8 @@ import {
|
||||
import { Tendermint34Client, toRfc3339WithNanoseconds } from "@cosmjs/tendermint-rpc";
|
||||
import { assert, sleep } from "@cosmjs/utils";
|
||||
|
||||
import { CodeInfoResponse } from "./codec/x/wasm/internal/types/query";
|
||||
import { ContractCodeHistoryOperationType } from "./codec/x/wasm/internal/types/types";
|
||||
import { CodeInfoResponse } from "./codec/cosmwasm/wasm/v1beta1/query";
|
||||
import { ContractCodeHistoryOperationType } from "./codec/cosmwasm/wasm/v1beta1/types";
|
||||
import { setupWasmExtension, WasmExtension } from "./queries";
|
||||
|
||||
/** Use for testing only */
|
||||
@ -276,24 +276,10 @@ export class CosmWasmClient {
|
||||
return codeDetails;
|
||||
}
|
||||
|
||||
public async getContracts(codeId: number): Promise<readonly Contract[]> {
|
||||
const { contractInfos } = await this.forceGetQueryClient().wasm.listContractsByCodeId(codeId);
|
||||
return (contractInfos || []).map(
|
||||
({ address, contractInfo }): Contract => {
|
||||
assert(address, "address missing");
|
||||
assert(
|
||||
contractInfo && contractInfo.codeId && contractInfo.creator && contractInfo.label,
|
||||
"contractInfo missing or incomplete",
|
||||
);
|
||||
return {
|
||||
address: address,
|
||||
codeId: contractInfo.codeId.toNumber(),
|
||||
creator: contractInfo.creator,
|
||||
admin: contractInfo.admin || undefined,
|
||||
label: contractInfo.label,
|
||||
};
|
||||
},
|
||||
);
|
||||
public async getContracts(codeId: number): Promise<readonly string[]> {
|
||||
// TODO: handle pagination - accept as arg or auto-loop
|
||||
const { contracts } = await this.forceGetQueryClient().wasm.listContractsByCodeId(codeId);
|
||||
return contracts;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "./codec/x/wasm/internal/types/tx";
|
||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
||||
|
||||
export interface MsgStoreCodeEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: "/cosmwasm.wasm.v1beta1.MsgStoreCode";
|
||||
|
||||
@ -12,11 +12,11 @@ import {
|
||||
SigningStargateClient,
|
||||
StdFee,
|
||||
} from "@cosmjs/stargate";
|
||||
import { assert, assertDefined } from "@cosmjs/utils";
|
||||
import { assert } from "@cosmjs/utils";
|
||||
import Long from "long";
|
||||
|
||||
import { MsgExecuteContract, MsgInstantiateContract, MsgStoreCode } from "../codec/x/wasm/internal/types/tx";
|
||||
import { ContractCodeHistoryOperationType } from "../codec/x/wasm/internal/types/types";
|
||||
import { MsgExecuteContract, MsgInstantiateContract, MsgStoreCode } from "../codec/cosmwasm/wasm/v1beta1/tx";
|
||||
import { ContractCodeHistoryOperationType } from "../codec/cosmwasm/wasm/v1beta1/types";
|
||||
import {
|
||||
MsgExecuteContractEncodeObject,
|
||||
MsgInstantiateContractEncodeObject,
|
||||
@ -25,7 +25,6 @@ import {
|
||||
import { SigningCosmWasmClient } from "../signingcosmwasmclient";
|
||||
import {
|
||||
alice,
|
||||
base64Matcher,
|
||||
bech32AddressMatcher,
|
||||
ContractUploadInstructions,
|
||||
getHackatom,
|
||||
@ -190,16 +189,10 @@ describe("WasmExtension", () => {
|
||||
const transferAmount = coins(707707, "ucosm");
|
||||
|
||||
// create new instance and compare before and after
|
||||
const { contractInfos: existingContractInfos } = await client.wasm.listContractsByCodeId(
|
||||
hackatomCodeId,
|
||||
);
|
||||
assert(existingContractInfos);
|
||||
for (const { address, contractInfo } of existingContractInfos) {
|
||||
const { contracts: existingContracts } = await client.wasm.listContractsByCodeId(hackatomCodeId);
|
||||
assert(existingContracts);
|
||||
for (const address of existingContracts) {
|
||||
expect(address).toMatch(bech32AddressMatcher);
|
||||
assertDefined(contractInfo);
|
||||
expect(contractInfo.codeId.toNumber()).toEqual(hackatomCodeId);
|
||||
expect(contractInfo.creator).toMatch(bech32AddressMatcher);
|
||||
expect(contractInfo.label).toMatch(/^.+$/);
|
||||
}
|
||||
|
||||
const result = await instantiateContract(wallet, hackatomCodeId, beneficiaryAddress, transferAmount);
|
||||
@ -208,17 +201,11 @@ describe("WasmExtension", () => {
|
||||
.events.find((event: any) => event.type === "message")
|
||||
.attributes!.find((attribute: any) => attribute.key === "contract_address").value;
|
||||
|
||||
const { contractInfos: newContractInfos } = await client.wasm.listContractsByCodeId(hackatomCodeId);
|
||||
assert(newContractInfos);
|
||||
expect(newContractInfos.length).toEqual(existingContractInfos.length + 1);
|
||||
const newContract = newContractInfos[newContractInfos.length - 1];
|
||||
expect({ ...newContract.contractInfo }).toEqual({
|
||||
codeId: Long.fromNumber(hackatomCodeId, true),
|
||||
creator: alice.address0,
|
||||
label: "my escrow",
|
||||
admin: "",
|
||||
ibcPortId: "",
|
||||
});
|
||||
const { contracts: newContracts } = await client.wasm.listContractsByCodeId(hackatomCodeId);
|
||||
assert(newContracts);
|
||||
expect(newContracts.length).toEqual(existingContracts.length + 1);
|
||||
const newContract = newContracts[newContracts.length - 1];
|
||||
expect(newContract).toMatch(bech32AddressMatcher);
|
||||
|
||||
const { contractInfo } = await client.wasm.getContractInfo(myAddress);
|
||||
assert(contractInfo);
|
||||
@ -295,8 +282,8 @@ describe("WasmExtension", () => {
|
||||
const data = models[0];
|
||||
expect(data.key).toEqual(hackatomConfigKey);
|
||||
const value = JSON.parse(fromAscii(data.value));
|
||||
expect(value.verifier).toMatch(base64Matcher);
|
||||
expect(value.beneficiary).toMatch(base64Matcher);
|
||||
expect(value.verifier).toMatch(bech32AddressMatcher);
|
||||
expect(value.beneficiary).toMatch(bech32AddressMatcher);
|
||||
});
|
||||
|
||||
it("rejects for non-existent address", async () => {
|
||||
@ -317,8 +304,8 @@ describe("WasmExtension", () => {
|
||||
const raw = await client.wasm.queryContractRaw(hackatomContractAddress, hackatomConfigKey);
|
||||
assert(raw.data, "must get result");
|
||||
const model = JSON.parse(fromAscii(raw.data));
|
||||
expect(model.verifier).toMatch(base64Matcher);
|
||||
expect(model.beneficiary).toMatch(base64Matcher);
|
||||
expect(model.verifier).toMatch(bech32AddressMatcher);
|
||||
expect(model.beneficiary).toMatch(bech32AddressMatcher);
|
||||
});
|
||||
|
||||
it("returns empty for missing key", async () => {
|
||||
@ -356,7 +343,7 @@ describe("WasmExtension", () => {
|
||||
const request = { nosuchkey: {} };
|
||||
await expectAsync(
|
||||
client.wasm.queryContractSmart(hackatomContractAddress, request),
|
||||
).toBeRejectedWithError(/Error parsing into type hackatom::contract::QueryMsg: unknown variant/i);
|
||||
).toBeRejectedWithError(/Error parsing into type hackatom::msg::QueryMsg: unknown variant/i);
|
||||
});
|
||||
|
||||
it("throws for non-existent address", async () => {
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
QueryContractInfoResponse,
|
||||
QueryContractsByCodeResponse,
|
||||
QueryRawContractStateResponse,
|
||||
} from "../codec/x/wasm/internal/types/query";
|
||||
} from "../codec/cosmwasm/wasm/v1beta1/query";
|
||||
|
||||
export interface WasmExtension {
|
||||
readonly wasm: {
|
||||
|
||||
@ -23,7 +23,7 @@ import Long from "long";
|
||||
import pako from "pako";
|
||||
import protobuf from "protobufjs/minimal";
|
||||
|
||||
import { MsgStoreCode } from "./codec/x/wasm/internal/types/tx";
|
||||
import { MsgStoreCode } from "./codec/cosmwasm/wasm/v1beta1/tx";
|
||||
import { MsgStoreCodeEncodeObject } from "./encodeobjects";
|
||||
import { PrivateSigningCosmWasmClient, SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
import {
|
||||
|
||||
@ -61,7 +61,7 @@ import {
|
||||
MsgMigrateContract,
|
||||
MsgStoreCode,
|
||||
MsgUpdateAdmin,
|
||||
} from "./codec/x/wasm/internal/types/tx";
|
||||
} from "./codec/cosmwasm/wasm/v1beta1/tx";
|
||||
import { CosmWasmClient } from "./cosmwasmclient";
|
||||
import {
|
||||
MsgClearAdminEncodeObject,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -84,27 +84,18 @@ export const unused = {
|
||||
};
|
||||
|
||||
export const validator = {
|
||||
/**
|
||||
* From first gentx's auth_info.signer_infos in scripts/wasmd/template/.wasmd/config/genesis.json
|
||||
*
|
||||
* `jq ".app_state.genutil.gen_txs[0].auth_info.signer_infos[0].public_key" scripts/wasmd/template/.wasmd/config/genesis.json`
|
||||
*/
|
||||
pubkey: {
|
||||
type: "tendermint/PubKeySecp256k1",
|
||||
value: "AoSRL8/aA1oDkHPd0IMtLpozhGdgFafzMCKmmOQ0olJn",
|
||||
},
|
||||
/**
|
||||
* delegator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
|
||||
*
|
||||
* `jq ".app_state.genutil.gen_txs[0].body.messages[0].delegator_address" scripts/wasmd/template/.wasmd/config/genesis.json`
|
||||
*/
|
||||
delegatorAddress: "wasm1jq32x9gj3n5lj2cgrcksypk3zegxnxgy8vzymc",
|
||||
delegatorAddress: "wasm1tjgue6r5kqj5dets24pwaa9u7wuzucpwuva0rv",
|
||||
/**
|
||||
* validator_address from /cosmos.staking.v1beta1.MsgCreateValidator in scripts/wasmd/template/.wasmd/config/genesis.json
|
||||
*
|
||||
* `jq ".app_state.genutil.gen_txs[0].body.messages[0].validator_address" scripts/wasmd/template/.wasmd/config/genesis.json`
|
||||
*/
|
||||
validatorAddress: "wasmvaloper1jq32x9gj3n5lj2cgrcksypk3zegxnxgyjshc4z",
|
||||
validatorAddress: "wasmvaloper1tjgue6r5kqj5dets24pwaa9u7wuzucpwfsgndk",
|
||||
accountNumber: 0,
|
||||
sequence: 1,
|
||||
};
|
||||
@ -114,7 +105,7 @@ 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: "08537c4f191980bc835f08ecb9077bb60df1097c1c0793312e0f21cbfca868d2",
|
||||
checksum: "3da31e1978e492d041a60905319f454f21b381beac274d07081aee390d0a63d7",
|
||||
instances: [
|
||||
{
|
||||
beneficiary: alice.address0,
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
c478a6d9d6303e67f28d7863ea6e07426e9f0082744557d503e723bc1c46ccf8 cw1_subkeys.wasm
|
||||
1a4a376ef1099ad3edc33aa1d3105e4621bc49e44b1ac0a449d7b6912e40fb0a cw3_fixed_multisig.wasm
|
||||
08537c4f191980bc835f08ecb9077bb60df1097c1c0793312e0f21cbfca868d2 hackatom.wasm
|
||||
7e27a7cbe2dde809d21cebe4b7fc546e131c7b4ffbe283e97dad423cc17e0706 cw1_subkeys.wasm
|
||||
8615889900edcd131531ffa85bb6706ece78ebde6b1bbf378ce0a813d49dac5f cw3_fixed_multisig.wasm
|
||||
3da31e1978e492d041a60905319f454f21b381beac274d07081aee390d0a63d7 hackatom.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.
13
scripts/wasmd/contracts/download.sh
Executable file
13
scripts/wasmd/contracts/download.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This must get from 2-3 different repos, fix the versions here:
|
||||
|
||||
COSMWASM_VERSION="v0.14.0-beta5"
|
||||
PLUS_VERSION="v0.6.0-beta3"
|
||||
|
||||
curl -L -O "https://github.com/CosmWasm/cosmwasm/releases/download/${COSMWASM_VERSION}/hackatom.wasm"
|
||||
|
||||
curl -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw1_subkeys.wasm"
|
||||
curl -L -O "https://github.com/CosmWasm/cosmwasm-plus/releases/download/${PLUS_VERSION}/cw3_fixed_multisig.wasm"
|
||||
|
||||
sha256sum *.wasm >checksums.sha256
|
||||
BIN
scripts/wasmd/contracts/hackatom.wasm
(Stored with Git LFS)
BIN
scripts/wasmd/contracts/hackatom.wasm
(Stored with Git LFS)
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
# Choose from https://hub.docker.com/r/cosmwasm/wasmd/tags
|
||||
REPOSITORY="cosmwasm/wasmd"
|
||||
VERSION="v0.16.0-alpha1"
|
||||
VERSION="v0.16.0-alpha2"
|
||||
|
||||
CONTAINER_NAME="wasmd"
|
||||
|
||||
@ -0,0 +1 @@
|
||||
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wNC0yOCAxOToxMjo0OS4yNjIyMDgwNzUgKzAwMDAgVVRDIG09KzAuMDk2ODczMTgxIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiSF9XUWNudGY2VGxqNFQxNiJ9.WAjSXIdvgurfHpOcsbGbDfF_dkYzuDgsqzwvaCVVC_ZWs_QJPabMcQ.0JKzC9a_gwfHG8BX.gNg23iY-12eghObLGoExcCO71scieougnJ5IWxUL_0G_-kSuMnUsms_MY4M4XtoaOFJudIXHbEOirKCjUjGeht91Zhiw6zD7pF0drzonXbzb_A-oce5xUt6fdw6S85uIZLOR0WDBsbNLOLKyHwIQoQUDf0i9kjpAksycSsnEpRlw4Wc3mIpA8bBebX0xZ4hanYuIBBeMSLdIH0g0NBm8EyIqW5kfT-Jxw1lC7Pqk_aIQT6nehP8T5Jgl.M696Eo97gziveGPF8dkGEA
|
||||
@ -1 +0,0 @@
|
||||
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0xMSAwNzozOTozOS42NDg4NTUxICswMDAwIFVUQyBtPSswLjY5MzgzNzMwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6IkZ1dDBwZ3piWDBnVzh0dE4ifQ.Ko268FeLtKNWdloqDVwFJjYyGBvs_ZF_K6M-2XP49X1DhjXq8Rd4ww.3EvDw48Dnv-mB79H.fMk_gMJjDfv6oe360q1QUZdJ4G1jgJ88zEAlXiqx_BsY_rmTKy9rfF_HU9C6OQIpfB8BBQSZx8ygqO56QNKEgi1IcQXQvN9UoGTd3kcbd954V7IaENQqH4_hlvLAWAbOhC8UyaCxisuNa774m9gDz9ljNfmL1ku6j4ZZIPyZkFSi7LSgs_UCAwzLbcR4KdoEjGQXb_8HcB55JX6wNbiqr3WzPlckDo7yrAJAR6w5fUmoR5dxeoD8ed_c.xXAyQKBSEbRbOuuDzznxGQ
|
||||
@ -5,206 +5,119 @@
|
||||
"accounts": [
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1jq32x9gj3n5lj2cgrcksypk3zegxnxgy8vzymc",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1tjgue6r5kqj5dets24pwaa9u7wuzucpwuva0rv"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1pkptre7fdkl6gfrzlesjjvhxhlc3r4gm32kke3",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1pkptre7fdkl6gfrzlesjjvhxhlc3r4gm32kke3"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm10dyr9899g6t0pelew4nvf4j5c3jcgv0r5d3a5l",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm10dyr9899g6t0pelew4nvf4j5c3jcgv0r5d3a5l"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1xy4yqngt0nlkdcenxymg8tenrghmek4n3u2lwa",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1xy4yqngt0nlkdcenxymg8tenrghmek4n3u2lwa"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm142u9fgcjdlycfcez3lw8x6x5h7rfjlnfaallkd",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm142u9fgcjdlycfcez3lw8x6x5h7rfjlnfaallkd"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1hsm76p4ahyhl5yh3ve9ur49r5kemhp2r93f89d",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1hsm76p4ahyhl5yh3ve9ur49r5kemhp2r93f89d"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83426at5",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83426at5"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1vkv9sfwaak76weyamqx0flmng2vuquxqjq3flu",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1vkv9sfwaak76weyamqx0flmng2vuquxqjq3flu"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm106jwym4s9aujcmes26myzzwqsccw09sd3nap5h",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm106jwym4s9aujcmes26myzzwqsccw09sd3nap5h"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1c7wpeen2uv8thayf7g8q2rgpm29clj0dzlu7t9",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1c7wpeen2uv8thayf7g8q2rgpm29clj0dzlu7t9"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1mjxpv9ft30wer7ma7kwfxhm42l379xuttrjcl3",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1mjxpv9ft30wer7ma7kwfxhm42l379xuttrjcl3"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1cjsxept9rkggzxztslae9ndgpdyt240842kpxh",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1cjsxept9rkggzxztslae9ndgpdyt240842kpxh"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm17d0jcz59jf68g52vq38tuuncmwwjk42us8fnse",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm17d0jcz59jf68g52vq38tuuncmwwjk42us8fnse"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1p6xs63q4g7np99ttv5nd3yzkt8n4qxa45jkgsk",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1p6xs63q4g7np99ttv5nd3yzkt8n4qxa45jkgsk"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1meeu3jl268txxytwmmrsljk8rawh6n2mhwp76p",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1meeu3jl268txxytwmmrsljk8rawh6n2mhwp76p"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1cak6lnpfxs035xd88sq8e4zujsm8g2g953hfan",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1cak6lnpfxs035xd88sq8e4zujsm8g2g953hfan"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1x3x8kyypx8z6q7fx3gw65x29mhl5gg8qtf4xkg",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1x3x8kyypx8z6q7fx3gw65x29mhl5gg8qtf4xkg"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm18c27m2rj4lg74md03ujralvt562c097nd7scqw",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm18c27m2rj4lg74md03ujralvt562c097nd7scqw"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1q2y53e6x7s5mlddtd2qkcjr3nwr4dszvs4js2q",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1q2y53e6x7s5mlddtd2qkcjr3nwr4dszvs4js2q"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1paa2gstlk7c98n27dw2g6tp6fyqvf32m3x04t6",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1paa2gstlk7c98n27dw2g6tp6fyqvf32m3x04t6"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1rvxjd8k6xvssz2eerfzemvat35pttfgrsz43tx",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1rvxjd8k6xvssz2eerfzemvat35pttfgrsz43tx"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm12zejt8d9xl70jd2333p4p265m2nr9h8g6pgmly",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm12zejt8d9xl70jd2333p4p265m2nr9h8g6pgmly"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1exctm2036jtwyc9v3ftqfzmgnv9tdhj2sskt4u",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1exctm2036jtwyc9v3ftqfzmgnv9tdhj2sskt4u"
|
||||
},
|
||||
{
|
||||
"@type": "/cosmos.auth.v1beta1.BaseAccount",
|
||||
"account_number": "0",
|
||||
"address": "wasm1f3pws3ztnp3s4nn5zxqdrl9vlqv5avkq3rjfe7",
|
||||
"pub_key": null,
|
||||
"sequence": "0"
|
||||
"address": "wasm1f3pws3ztnp3s4nn5zxqdrl9vlqv5avkq3rjfe7"
|
||||
}
|
||||
],
|
||||
"params": {
|
||||
@ -373,6 +286,19 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "wasm1tjgue6r5kqj5dets24pwaa9u7wuzucpwuva0rv",
|
||||
"coins": [
|
||||
{
|
||||
"amount": "1000000000",
|
||||
"denom": "ucosm"
|
||||
},
|
||||
{
|
||||
"amount": "1000000000",
|
||||
"denom": "ustake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "wasm1vkv9sfwaak76weyamqx0flmng2vuquxqjq3flu",
|
||||
"coins": [
|
||||
@ -412,19 +338,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "wasm1jq32x9gj3n5lj2cgrcksypk3zegxnxgy8vzymc",
|
||||
"coins": [
|
||||
{
|
||||
"amount": "1000000000",
|
||||
"denom": "ucosm"
|
||||
},
|
||||
{
|
||||
"amount": "1000000000",
|
||||
"denom": "ustake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk",
|
||||
"coins": [
|
||||
@ -625,7 +538,6 @@
|
||||
"community_tax": "0.020000000000000000",
|
||||
"withdraw_addr_enabled": true
|
||||
},
|
||||
"previous_proposer": "",
|
||||
"validator_accumulated_commissions": [],
|
||||
"validator_current_rewards": [],
|
||||
"validator_historical_rewards": [],
|
||||
@ -653,7 +565,7 @@
|
||||
},
|
||||
"public_key": {
|
||||
"@type": "/cosmos.crypto.secp256k1.PubKey",
|
||||
"key": "AoSRL8/aA1oDkHPd0IMtLpozhGdgFafzMCKmmOQ0olJn"
|
||||
"key": "AjOB0SSyyLVBcOe0GK0TuLmXlCVWY/h8cnhKvwbnbdII"
|
||||
},
|
||||
"sequence": "0"
|
||||
}
|
||||
@ -661,7 +573,7 @@
|
||||
},
|
||||
"body": {
|
||||
"extension_options": [],
|
||||
"memo": "35c6d5ac272deb6b94487979a508ad2092e0e8bc@172.17.0.2:26656",
|
||||
"memo": "aea250e19e1f2274c0be3059609fc10ffa79dd64@172.17.0.3:26656",
|
||||
"messages": [
|
||||
{
|
||||
"@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
|
||||
@ -670,7 +582,7 @@
|
||||
"max_rate": "0.200000000000000000",
|
||||
"rate": "0.100000000000000000"
|
||||
},
|
||||
"delegator_address": "wasm1jq32x9gj3n5lj2cgrcksypk3zegxnxgy8vzymc",
|
||||
"delegator_address": "wasm1tjgue6r5kqj5dets24pwaa9u7wuzucpwuva0rv",
|
||||
"description": {
|
||||
"details": "",
|
||||
"identity": "",
|
||||
@ -681,9 +593,9 @@
|
||||
"min_self_delegation": "1",
|
||||
"pubkey": {
|
||||
"@type": "/cosmos.crypto.ed25519.PubKey",
|
||||
"key": "ngPVy1v4JClXBkz712hruDsNCVtR8p7AdcbbmJKreoY="
|
||||
"key": "BP6bNEKlXpH+HUe7x0NO/GhSvz08dXgNUI+PSkjUiM4="
|
||||
},
|
||||
"validator_address": "wasmvaloper1jq32x9gj3n5lj2cgrcksypk3zegxnxgyjshc4z",
|
||||
"validator_address": "wasmvaloper1tjgue6r5kqj5dets24pwaa9u7wuzucpwfsgndk",
|
||||
"value": {
|
||||
"amount": "250000000",
|
||||
"denom": "ustake"
|
||||
@ -694,7 +606,7 @@
|
||||
"timeout_height": "0"
|
||||
},
|
||||
"signatures": [
|
||||
"zm5EzuTaWoKLAwnlxIYrkNdE6JShAqPMSGBJQ9+qUVdsgmf8ov3pqtllN/WzOqGy/IuH9OVE4KOW9fKSd0U2/g=="
|
||||
"RqDfX8WkDlyJNIlTZw13yBi/HhujaSjuJBUij+izS5MI3b6zAi6yALzR2+18McjzqjqaE61kLvg+07ETJuE+0g=="
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -709,15 +621,12 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"deposits": [],
|
||||
"proposals": [],
|
||||
"starting_proposal_id": "1",
|
||||
"tally_params": {
|
||||
"quorum": "0.334000000000000000",
|
||||
"threshold": "0.500000000000000000",
|
||||
"veto_threshold": "0.334000000000000000"
|
||||
},
|
||||
"votes": [],
|
||||
"voting_params": {
|
||||
"voting_period": "172800s"
|
||||
}
|
||||
@ -728,7 +637,6 @@
|
||||
"acknowledgements": [],
|
||||
"channels": [],
|
||||
"commitments": [],
|
||||
"next_channel_sequence": "0",
|
||||
"receipts": [],
|
||||
"recv_sequences": [],
|
||||
"send_sequences": []
|
||||
@ -736,9 +644,6 @@
|
||||
"client_genesis": {
|
||||
"clients": [],
|
||||
"clients_consensus": [],
|
||||
"clients_metadata": [],
|
||||
"create_localhost": false,
|
||||
"next_client_sequence": "0",
|
||||
"params": {
|
||||
"allowed_clients": [
|
||||
"06-solomachine",
|
||||
@ -748,8 +653,7 @@
|
||||
},
|
||||
"connection_genesis": {
|
||||
"client_connection_paths": [],
|
||||
"connections": [],
|
||||
"next_connection_sequence": "0"
|
||||
"connections": []
|
||||
}
|
||||
},
|
||||
"mint": {
|
||||
@ -779,20 +683,14 @@
|
||||
"signing_infos": []
|
||||
},
|
||||
"staking": {
|
||||
"delegations": [],
|
||||
"exported": false,
|
||||
"last_total_power": "0",
|
||||
"last_validator_powers": [],
|
||||
"params": {
|
||||
"bond_denom": "ustake",
|
||||
"historical_entries": 10000,
|
||||
"max_entries": 7,
|
||||
"max_validators": 100,
|
||||
"unbonding_time": "1814400s"
|
||||
},
|
||||
"redelegations": [],
|
||||
"unbonding_delegations": [],
|
||||
"validators": []
|
||||
}
|
||||
},
|
||||
"transfer": {
|
||||
"denom_traces": [],
|
||||
@ -805,18 +703,13 @@
|
||||
"upgrade": {},
|
||||
"vesting": {},
|
||||
"wasm": {
|
||||
"codes": [],
|
||||
"contracts": [],
|
||||
"gen_msgs": [],
|
||||
"params": {
|
||||
"code_upload_access": {
|
||||
"address": "",
|
||||
"permission": "Everybody"
|
||||
},
|
||||
"instantiate_default_permission": "Everybody",
|
||||
"max_wasm_code_size": "614400"
|
||||
},
|
||||
"sequences": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"chain_id": "testing",
|
||||
@ -838,6 +731,6 @@
|
||||
},
|
||||
"version": {}
|
||||
},
|
||||
"genesis_time": "2021-03-11T07:39:38.4466445Z",
|
||||
"genesis_time": "2021-04-28T19:12:49.122276671Z",
|
||||
"initial_height": "1"
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"node001","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"wasm1jq32x9gj3n5lj2cgrcksypk3zegxnxgy8vzymc","validator_address":"wasmvaloper1jq32x9gj3n5lj2cgrcksypk3zegxnxgyjshc4z","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"ngPVy1v4JClXBkz712hruDsNCVtR8p7AdcbbmJKreoY="},"value":{"denom":"ustake","amount":"250000000"}}],"memo":"35c6d5ac272deb6b94487979a508ad2092e0e8bc@172.17.0.2:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AoSRL8/aA1oDkHPd0IMtLpozhGdgFafzMCKmmOQ0olJn"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["zm5EzuTaWoKLAwnlxIYrkNdE6JShAqPMSGBJQ9+qUVdsgmf8ov3pqtllN/WzOqGy/IuH9OVE4KOW9fKSd0U2/g=="]}
|
||||
@ -0,0 +1 @@
|
||||
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"node001","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"wasm1tjgue6r5kqj5dets24pwaa9u7wuzucpwuva0rv","validator_address":"wasmvaloper1tjgue6r5kqj5dets24pwaa9u7wuzucpwfsgndk","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"BP6bNEKlXpH+HUe7x0NO/GhSvz08dXgNUI+PSkjUiM4="},"value":{"denom":"ustake","amount":"250000000"}}],"memo":"aea250e19e1f2274c0be3059609fc10ffa79dd64@172.17.0.3:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AjOB0SSyyLVBcOe0GK0TuLmXlCVWY/h8cnhKvwbnbdII"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["RqDfX8WkDlyJNIlTZw13yBi/HhujaSjuJBUij+izS5MI3b6zAi6yALzR2+18McjzqjqaE61kLvg+07ETJuE+0g=="]}
|
||||
@ -1 +1 @@
|
||||
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"oqsLor7VWzHrqKN7uVh4kk+BkEpMSsbn9tZa68XBjCwchfZqpLmOfsEm9/i/CybCk49EiADcNE3jNrOyq2FGpQ=="}}
|
||||
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"DW7KyPeVXdiFn7hFFhA1rYzv5d5+5SJHo4bN8coxLicvNrTDtpWgf8GjVMdgvJlR1xOY8h3Rg8vlm+7TfXxSDQ=="}}
|
||||
@ -1,11 +1,11 @@
|
||||
{
|
||||
"address": "78651C29E659E5D06BA245039C5F44BEB1C01774",
|
||||
"address": "3D447C15EAE7C1121E00435AB012F124A514DE5F",
|
||||
"pub_key": {
|
||||
"type": "tendermint/PubKeyEd25519",
|
||||
"value": "ngPVy1v4JClXBkz712hruDsNCVtR8p7AdcbbmJKreoY="
|
||||
"value": "BP6bNEKlXpH+HUe7x0NO/GhSvz08dXgNUI+PSkjUiM4="
|
||||
},
|
||||
"priv_key": {
|
||||
"type": "tendermint/PrivKeyEd25519",
|
||||
"value": "WQbL+VCDG5/YJDXrypKeR6b5uhMQgPZVs3CQCYmMKuqeA9XLW/gkKVcGTPvXaGu4Ow0JW1HynsB1xtuYkqt6hg=="
|
||||
"value": "Pz/Tz88OySXwTEy6cdygCcZkZOHnJyUpM8h0vYO3JrAE/ps0QqVekf4dR7vHQ078aFK/PTx1eA1Qj49KSNSIzg=="
|
||||
}
|
||||
}
|
||||
@ -1 +1 @@
|
||||
$2a$10$8FdjyO2zScfgsgxrxjG5s.TMFkpbFZb4H6GQ6hmGep21of6dV8L0O
|
||||
$2a$10$k8hjFNzXqTtzIHmnlmf7Hev7Y70vx39r1bD7Htj8hLXJPNnYhg4pi
|
||||
@ -1 +1 @@
|
||||
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0xMSAwNzozOTozOS42MjMzMjI3ICswMDAwIFVUQyBtPSswLjY2ODMwNTQwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6IkdKQTNLTzNVZzdoLW4xYW0ifQ.XtBGKi7nPRDO2fHP5yN0A7bkvTqvpUIfwewVrp6jle01oMOO12F-6g.Up8OH1fP06oI7bAW.l1syzsMJreyVVPf-VvOtGWTo4ujPkhtlxNPkfMwsJPGz4cMwoRsrlq1yvD6vqU0kVwUjLDKsKuPjciKpL057ssQf4lIArss-k-GIULkZx_pzBSCqHRqXRhvgCAUxqhLteeSw5WIYq_BwdrTTTP7pa41GwLNjHI7-1CiSeh6fluTwp-rfkOikgyTu02UZi6LOcagynkMQ206yPQAG6iCg1r_j2S-UxklwO7U2aYTYnsnOA_wPYlBjPtu5DSWZ4l8gtncwvSEjb8di-3duhbcBHuv17ArcFBbnBrJ4XpOsxoZIFEippjzE6olwojWU8Ge37cLX4VI7E9jSw8BD18_kXlxmzvAWZZcAxP8T3m6TZKYkDyWd.5Dlq3dI0r7cI6y4E78PZCw
|
||||
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wNC0yOCAxOToxMjo0OS4yNTgwODMwMzIgKzAwMDAgVVRDIG09KzAuMDkyNzQ4MTM4IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiOE55NktPTHZ0Z0wyeWdZdyJ9.aUeIj6LPohJ7r9m_pByAP_DSfDPGUY-lsUvPt9cJfsnT_D43PrUuzA.XV5oqJrLiM9mwcwd.8EsHSAHV9pdl29Tw9A5EKdmcdCjWEo3pWjp3t52DwPEHnn-NGmzeKv0t0DWuvYtaY8t0AAadtiAv1VQqp5J0-PpUtwpc9YsMUNrb2Z-3f7swkRbhap4qofoqZ3XSBRpFGdcmT7MpZbQdMlG5tkJUoG0vOtuxyMsXc_xl9t6uaX5yhzIvTMV0Qp8LJ0lPr3P8I52weihxLvp3a5_-cgWdPvQuTaVBJHh3eI10hna_mkewwYxOmBaXsH1XAkr_VhGc54BkA8h64XAu9Ci8jKmnyjd-N9n6tAwyLJgn_VTVl8IYf_NY64_MCVvPlffhSKRi74_kz2CzCsH_y776giIWvwW69xaulYVk8AB5G8qLFfxNjBgC.SmgI7IFtsABQCNlgveqMmw
|
||||
Loading…
Reference in New Issue
Block a user