feat: Port x/wasm module #92
109
proto/wasm/v1/authz.proto
Normal file
109
proto/wasm/v1/authz.proto
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "google/protobuf/any.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
|
||||||
|
// ContractExecutionAuthorization defines authorization for wasm execute.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message ContractExecutionAuthorization {
|
||||||
|
option (cosmos_proto.implements_interface) = "Authorization";
|
||||||
|
|
||||||
|
// Grants for contract executions
|
||||||
|
repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractMigrationAuthorization defines authorization for wasm contract
|
||||||
|
// migration. Since: wasmd 0.30
|
||||||
|
message ContractMigrationAuthorization {
|
||||||
|
option (cosmos_proto.implements_interface) = "Authorization";
|
||||||
|
|
||||||
|
// Grants for contract migrations
|
||||||
|
repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractGrant a granted permission for a single contract
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message ContractGrant {
|
||||||
|
// Contract is the bech32 address of the smart contract
|
||||||
|
string contract = 1;
|
||||||
|
|
||||||
|
// Limit defines execution limits that are enforced and updated when the grant
|
||||||
|
// is applied. When the limit lapsed the grant is removed.
|
||||||
|
google.protobuf.Any limit = 2
|
||||||
|
[ (cosmos_proto.accepts_interface) = "ContractAuthzLimitX" ];
|
||||||
|
|
||||||
|
// Filter define more fine-grained control on the message payload passed
|
||||||
|
// to the contract in the operation. When no filter applies on execution, the
|
||||||
|
// operation is prohibited.
|
||||||
|
google.protobuf.Any filter = 3
|
||||||
|
[ (cosmos_proto.accepts_interface) = "ContractAuthzFilterX" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MaxCallsLimit limited number of calls to the contract. No funds transferable.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message MaxCallsLimit {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzLimitX";
|
||||||
|
|
||||||
|
// Remaining number that is decremented on each execution
|
||||||
|
uint64 remaining = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MaxFundsLimit defines the maximal amounts that can be sent to the contract.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message MaxFundsLimit {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzLimitX";
|
||||||
|
|
||||||
|
// Amounts is the maximal amount of tokens transferable to the contract.
|
||||||
|
repeated cosmos.base.v1beta1.Coin amounts = 1 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// CombinedLimit defines the maximal amounts that can be sent to a contract and
|
||||||
|
// the maximal number of calls executable. Both need to remain >0 to be valid.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message CombinedLimit {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzLimitX";
|
||||||
|
|
||||||
|
// Remaining number that is decremented on each execution
|
||||||
|
uint64 calls_remaining = 1;
|
||||||
|
// Amounts is the maximal amount of tokens transferable to the contract.
|
||||||
|
repeated cosmos.base.v1beta1.Coin amounts = 2 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// AllowAllMessagesFilter is a wildcard to allow any type of contract payload
|
||||||
|
// message.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message AllowAllMessagesFilter {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzFilterX";
|
||||||
|
}
|
||||||
|
|
||||||
|
// AcceptedMessageKeysFilter accept only the specific contract message keys in
|
||||||
|
// the json object to be executed.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message AcceptedMessageKeysFilter {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzFilterX";
|
||||||
|
|
||||||
|
// Messages is the list of unique keys
|
||||||
|
repeated string keys = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// AcceptedMessagesFilter accept only the specific raw contract messages to be
|
||||||
|
// executed.
|
||||||
|
// Since: wasmd 0.30
|
||||||
|
message AcceptedMessagesFilter {
|
||||||
|
option (cosmos_proto.implements_interface) = "ContractAuthzFilterX";
|
||||||
|
|
||||||
|
// Messages is the list of raw contract messages
|
||||||
|
repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
46
proto/wasm/v1/genesis.proto
Normal file
46
proto/wasm/v1/genesis.proto
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "wasm/v1/types.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
|
||||||
|
// GenesisState - genesis state of x/wasm
|
||||||
|
message GenesisState {
|
||||||
|
Params params = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
repeated Code codes = 2
|
||||||
|
[ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ];
|
||||||
|
repeated Contract contracts = 3 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.jsontag) = "contracts,omitempty"
|
||||||
|
];
|
||||||
|
repeated Sequence sequences = 4 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.jsontag) = "sequences,omitempty"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code struct encompasses CodeInfo and CodeBytes
|
||||||
|
message Code {
|
||||||
|
uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
CodeInfo code_info = 2 [ (gogoproto.nullable) = false ];
|
||||||
|
bytes code_bytes = 3;
|
||||||
|
// Pinned to wasmvm cache
|
||||||
|
bool pinned = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Contract struct encompasses ContractAddress, ContractInfo, and ContractState
|
||||||
|
message Contract {
|
||||||
|
string contract_address = 1;
|
||||||
|
ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ];
|
||||||
|
repeated Model contract_state = 3 [ (gogoproto.nullable) = false ];
|
||||||
|
repeated ContractCodeHistoryEntry contract_code_history = 4
|
||||||
|
[ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sequence key and value of an id generation counter
|
||||||
|
message Sequence {
|
||||||
|
bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ];
|
||||||
|
uint64 value = 2;
|
||||||
|
}
|
31
proto/wasm/v1/ibc.proto
Normal file
31
proto/wasm/v1/ibc.proto
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
|
||||||
|
// MsgIBCSend
|
||||||
|
message MsgIBCSend {
|
||||||
|
// the channel by which the packet will be sent
|
||||||
|
string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
|
||||||
|
|
||||||
|
// Timeout height relative to the current block height.
|
||||||
|
// The timeout is disabled when set to 0.
|
||||||
|
uint64 timeout_height = 4
|
||||||
|
[ (gogoproto.moretags) = "yaml:\"timeout_height\"" ];
|
||||||
|
// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
|
||||||
|
// The timeout is disabled when set to 0.
|
||||||
|
uint64 timeout_timestamp = 5
|
||||||
|
[ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ];
|
||||||
|
|
||||||
|
// Data is the payload to transfer. We must not make assumption what format or
|
||||||
|
// content is in here.
|
||||||
|
bytes data = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgIBCCloseChannel port and channel need to be owned by the contract
|
||||||
|
message MsgIBCCloseChannel {
|
||||||
|
string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
|
||||||
|
}
|
272
proto/wasm/v1/proposal.proto
Normal file
272
proto/wasm/v1/proposal.proto
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "wasm/v1/types.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_stringer_all) = false;
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
option (gogoproto.equal_all) = true;
|
||||||
|
|
||||||
|
// StoreCodeProposal gov proposal content type to submit WASM code to the system
|
||||||
|
message StoreCodeProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// RunAs is the address that is passed to the contract's environment as sender
|
||||||
|
string run_as = 3;
|
||||||
|
// WASMByteCode can be raw or gzip compressed
|
||||||
|
bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ];
|
||||||
|
// Used in v1beta1
|
||||||
|
reserved 5, 6;
|
||||||
|
// InstantiatePermission to apply on contract creation, optional
|
||||||
|
AccessConfig instantiate_permission = 7;
|
||||||
|
// UnpinCode code on upload, optional
|
||||||
|
bool unpin_code = 8;
|
||||||
|
// Source is the URL where the code is hosted
|
||||||
|
string source = 9;
|
||||||
|
// Builder is the docker image used to build the code deterministically, used
|
||||||
|
// for smart contract verification
|
||||||
|
string builder = 10;
|
||||||
|
// CodeHash is the SHA256 sum of the code outputted by builder, used for smart
|
||||||
|
// contract verification
|
||||||
|
bytes code_hash = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
// InstantiateContractProposal gov proposal content type to instantiate a
|
||||||
|
// contract.
|
||||||
|
message InstantiateContractProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// RunAs is the address that is passed to the contract's environment as sender
|
||||||
|
string run_as = 3;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 4;
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Label is optional metadata to be stored with a constract instance.
|
||||||
|
string label = 6;
|
||||||
|
// Msg json encoded message to be passed to the contract on instantiation
|
||||||
|
bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 8 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// InstantiateContract2Proposal gov proposal content type to instantiate
|
||||||
|
// contract 2
|
||||||
|
message InstantiateContract2Proposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// RunAs is the address that is passed to the contract's enviroment as sender
|
||||||
|
string run_as = 3;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 4;
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Label is optional metadata to be stored with a constract instance.
|
||||||
|
string label = 6;
|
||||||
|
// Msg json encode message to be passed to the contract on instantiation
|
||||||
|
bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 8 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
// Salt is an arbitrary value provided by the sender. Size can be 1 to 64.
|
||||||
|
bytes salt = 9;
|
||||||
|
// FixMsg include the msg value into the hash for the predictable address.
|
||||||
|
// Default is false
|
||||||
|
bool fix_msg = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateContractProposal gov proposal content type to migrate a contract.
|
||||||
|
message MigrateContractProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// Note: skipping 3 as this was previously used for unneeded run_as
|
||||||
|
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 4;
|
||||||
|
// CodeID references the new WASM code
|
||||||
|
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Msg json encoded message to be passed to the contract on migration
|
||||||
|
bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// SudoContractProposal gov proposal content type to call sudo on a contract.
|
||||||
|
message SudoContractProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 3;
|
||||||
|
// Msg json encoded message to be passed to the contract as sudo
|
||||||
|
bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExecuteContractProposal gov proposal content type to call execute on a
|
||||||
|
// contract.
|
||||||
|
message ExecuteContractProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// RunAs is the address that is passed to the contract's environment as sender
|
||||||
|
string run_as = 3;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 4;
|
||||||
|
// Msg json encoded message to be passed to the contract as execute
|
||||||
|
bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 6 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateAdminProposal gov proposal content type to set an admin for a contract.
|
||||||
|
message UpdateAdminProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// NewAdmin address to be set
|
||||||
|
string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClearAdminProposal gov proposal content type to clear the admin of a
|
||||||
|
// contract.
|
||||||
|
message ClearAdminProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// PinCodesProposal gov proposal content type to pin a set of code ids in the
|
||||||
|
// wasmvm cache.
|
||||||
|
message PinCodesProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
|
||||||
|
// CodeIDs references the new WASM codes
|
||||||
|
repeated uint64 code_ids = 3 [
|
||||||
|
(gogoproto.customname) = "CodeIDs",
|
||||||
|
(gogoproto.moretags) = "yaml:\"code_ids\""
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnpinCodesProposal gov proposal content type to unpin a set of code ids in
|
||||||
|
// the wasmvm cache.
|
||||||
|
message UnpinCodesProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
|
||||||
|
// CodeIDs references the WASM codes
|
||||||
|
repeated uint64 code_ids = 3 [
|
||||||
|
(gogoproto.customname) = "CodeIDs",
|
||||||
|
(gogoproto.moretags) = "yaml:\"code_ids\""
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccessConfigUpdate contains the code id and the access config to be
|
||||||
|
// applied.
|
||||||
|
message AccessConfigUpdate {
|
||||||
|
// CodeID is the reference to the stored WASM code to be updated
|
||||||
|
uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// InstantiatePermission to apply to the set of code ids
|
||||||
|
AccessConfig instantiate_permission = 2 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateInstantiateConfigProposal gov proposal content type to update
|
||||||
|
// instantiate config to a set of code ids.
|
||||||
|
message UpdateInstantiateConfigProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
|
||||||
|
// AccessConfigUpdate contains the list of code ids and the access config
|
||||||
|
// to be applied.
|
||||||
|
repeated AccessConfigUpdate access_config_updates = 3
|
||||||
|
[ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// StoreAndInstantiateContractProposal gov proposal content type to store
|
||||||
|
// and instantiate the contract.
|
||||||
|
message StoreAndInstantiateContractProposal {
|
||||||
|
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
|
||||||
|
|
||||||
|
// Title is a short summary
|
||||||
|
string title = 1;
|
||||||
|
// Description is a human readable text
|
||||||
|
string description = 2;
|
||||||
|
// RunAs is the address that is passed to the contract's environment as sender
|
||||||
|
string run_as = 3;
|
||||||
|
// WASMByteCode can be raw or gzip compressed
|
||||||
|
bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ];
|
||||||
|
// InstantiatePermission to apply on contract creation, optional
|
||||||
|
AccessConfig instantiate_permission = 5;
|
||||||
|
// UnpinCode code on upload, optional
|
||||||
|
bool unpin_code = 6;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 7;
|
||||||
|
// Label is optional metadata to be stored with a constract instance.
|
||||||
|
string label = 8;
|
||||||
|
// Msg json encoded message to be passed to the contract on instantiation
|
||||||
|
bytes msg = 9 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 10 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
// Source is the URL where the code is hosted
|
||||||
|
string source = 11;
|
||||||
|
// Builder is the docker image used to build the code deterministically, used
|
||||||
|
// for smart contract verification
|
||||||
|
string builder = 12;
|
||||||
|
// CodeHash is the SHA256 sum of the code outputted by builder, used for smart
|
||||||
|
// contract verification
|
||||||
|
bytes code_hash = 13;
|
||||||
|
}
|
263
proto/wasm/v1/query.proto
Normal file
263
proto/wasm/v1/query.proto
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "wasm/v1/types.proto";
|
||||||
|
import "google/api/annotations.proto";
|
||||||
|
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
option (gogoproto.equal_all) = false;
|
||||||
|
|
||||||
|
// Query provides defines the gRPC querier service
|
||||||
|
service Query {
|
||||||
|
// ContractInfo gets the contract meta data
|
||||||
|
rpc ContractInfo(QueryContractInfoRequest)
|
||||||
|
returns (QueryContractInfoResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}";
|
||||||
|
}
|
||||||
|
// ContractHistory gets the contract code history
|
||||||
|
rpc ContractHistory(QueryContractHistoryRequest)
|
||||||
|
returns (QueryContractHistoryResponse) {
|
||||||
|
option (google.api.http).get =
|
||||||
|
"/cosmwasm/wasm/v1/contract/{address}/history";
|
||||||
|
}
|
||||||
|
// ContractsByCode lists all smart contracts for a code id
|
||||||
|
rpc ContractsByCode(QueryContractsByCodeRequest)
|
||||||
|
returns (QueryContractsByCodeResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts";
|
||||||
|
}
|
||||||
|
// AllContractState gets all raw store data for a single contract
|
||||||
|
rpc AllContractState(QueryAllContractStateRequest)
|
||||||
|
returns (QueryAllContractStateResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state";
|
||||||
|
}
|
||||||
|
// RawContractState gets single key from the raw store data of a contract
|
||||||
|
rpc RawContractState(QueryRawContractStateRequest)
|
||||||
|
returns (QueryRawContractStateResponse) {
|
||||||
|
option (google.api.http).get =
|
||||||
|
"/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}";
|
||||||
|
}
|
||||||
|
// SmartContractState get smart query result from the contract
|
||||||
|
rpc SmartContractState(QuerySmartContractStateRequest)
|
||||||
|
returns (QuerySmartContractStateResponse) {
|
||||||
|
option (google.api.http).get =
|
||||||
|
"/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}";
|
||||||
|
}
|
||||||
|
// Code gets the binary code and metadata for a singe wasm code
|
||||||
|
rpc Code(QueryCodeRequest) returns (QueryCodeResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}";
|
||||||
|
}
|
||||||
|
// Codes gets the metadata for all stored wasm codes
|
||||||
|
rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/code";
|
||||||
|
}
|
||||||
|
|
||||||
|
// PinnedCodes gets the pinned code ids
|
||||||
|
rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params gets the module params
|
||||||
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||||
|
option (google.api.http).get = "/cosmwasm/wasm/v1/codes/params";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractsByCreator gets the contracts by creator
|
||||||
|
rpc ContractsByCreator(QueryContractsByCreatorRequest)
|
||||||
|
returns (QueryContractsByCreatorResponse) {
|
||||||
|
option (google.api.http).get =
|
||||||
|
"/cosmwasm/wasm/v1/contracts/creator/{creator_address}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
|
||||||
|
// method
|
||||||
|
message QueryContractInfoRequest {
|
||||||
|
// address is the address of the contract to query
|
||||||
|
string address = 1;
|
||||||
|
}
|
||||||
|
// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC
|
||||||
|
// method
|
||||||
|
message QueryContractInfoResponse {
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
|
// address is the address of the contract
|
||||||
|
string address = 1;
|
||||||
|
ContractInfo contract_info = 2 [
|
||||||
|
(gogoproto.embed) = true,
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.jsontag) = ""
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractHistoryRequest is the request type for the Query/ContractHistory
|
||||||
|
// RPC method
|
||||||
|
message QueryContractHistoryRequest {
|
||||||
|
// address is the address of the contract to query
|
||||||
|
string address = 1;
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractHistoryResponse is the response type for the
|
||||||
|
// Query/ContractHistory RPC method
|
||||||
|
message QueryContractHistoryResponse {
|
||||||
|
repeated ContractCodeHistoryEntry entries = 1
|
||||||
|
[ (gogoproto.nullable) = false ];
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode
|
||||||
|
// RPC method
|
||||||
|
message QueryContractsByCodeRequest {
|
||||||
|
uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractsByCodeResponse is the response type for the
|
||||||
|
// Query/ContractsByCode RPC method
|
||||||
|
message QueryContractsByCodeResponse {
|
||||||
|
// contracts are a set of contract addresses
|
||||||
|
repeated string contracts = 1;
|
||||||
|
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryAllContractStateRequest is the request type for the
|
||||||
|
// Query/AllContractState RPC method
|
||||||
|
message QueryAllContractStateRequest {
|
||||||
|
// address is the address of the contract
|
||||||
|
string address = 1;
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryAllContractStateResponse is the response type for the
|
||||||
|
// Query/AllContractState RPC method
|
||||||
|
message QueryAllContractStateResponse {
|
||||||
|
repeated Model models = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryRawContractStateRequest is the request type for the
|
||||||
|
// Query/RawContractState RPC method
|
||||||
|
message QueryRawContractStateRequest {
|
||||||
|
// address is the address of the contract
|
||||||
|
string address = 1;
|
||||||
|
bytes query_data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryRawContractStateResponse is the response type for the
|
||||||
|
// Query/RawContractState RPC method
|
||||||
|
message QueryRawContractStateResponse {
|
||||||
|
// Data contains the raw store data
|
||||||
|
bytes data = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QuerySmartContractStateRequest is the request type for the
|
||||||
|
// Query/SmartContractState RPC method
|
||||||
|
message QuerySmartContractStateRequest {
|
||||||
|
// address is the address of the contract
|
||||||
|
string address = 1;
|
||||||
|
// QueryData contains the query data passed to the contract
|
||||||
|
bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QuerySmartContractStateResponse is the response type for the
|
||||||
|
// Query/SmartContractState RPC method
|
||||||
|
message QuerySmartContractStateResponse {
|
||||||
|
// Data contains the json data returned from the smart contract
|
||||||
|
bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryCodeRequest is the request type for the Query/Code RPC method
|
||||||
|
message QueryCodeRequest {
|
||||||
|
uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
|
||||||
|
}
|
||||||
|
|
||||||
|
// CodeInfoResponse contains code meta data from CodeInfo
|
||||||
|
message CodeInfoResponse {
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
|
uint64 code_id = 1 [
|
||||||
|
(gogoproto.customname) = "CodeID",
|
||||||
|
(gogoproto.jsontag) = "id"
|
||||||
|
]; // id for legacy support
|
||||||
|
string creator = 2;
|
||||||
|
bytes data_hash = 3
|
||||||
|
[ (gogoproto.casttype) =
|
||||||
|
"github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
|
||||||
|
// Used in v1beta1
|
||||||
|
reserved 4, 5;
|
||||||
|
AccessConfig instantiate_permission = 6 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryCodeResponse is the response type for the Query/Code RPC method
|
||||||
|
message QueryCodeResponse {
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
CodeInfoResponse code_info = 1
|
||||||
|
[ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ];
|
||||||
|
bytes data = 2 [ (gogoproto.jsontag) = "data" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryCodesRequest is the request type for the Query/Codes RPC method
|
||||||
|
message QueryCodesRequest {
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryCodesResponse is the response type for the Query/Codes RPC method
|
||||||
|
message QueryCodesResponse {
|
||||||
|
repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes
|
||||||
|
// RPC method
|
||||||
|
message QueryPinnedCodesRequest {
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryPinnedCodesResponse is the response type for the
|
||||||
|
// Query/PinnedCodes RPC method
|
||||||
|
message QueryPinnedCodesResponse {
|
||||||
|
repeated uint64 code_ids = 1
|
||||||
|
[ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ];
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryParamsRequest is the request type for the Query/Params RPC method.
|
||||||
|
message QueryParamsRequest {}
|
||||||
|
|
||||||
|
// QueryParamsResponse is the response type for the Query/Params RPC method.
|
||||||
|
message QueryParamsResponse {
|
||||||
|
// params defines the parameters of the module.
|
||||||
|
Params params = 1 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractsByCreatorRequest is the request type for the
|
||||||
|
// Query/ContractsByCreator RPC method.
|
||||||
|
message QueryContractsByCreatorRequest {
|
||||||
|
// CreatorAddress is the address of contract creator
|
||||||
|
string creator_address = 1;
|
||||||
|
// Pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QueryContractsByCreatorResponse is the response type for the
|
||||||
|
// Query/ContractsByCreator RPC method.
|
||||||
|
message QueryContractsByCreatorResponse {
|
||||||
|
// ContractAddresses result set
|
||||||
|
repeated string contract_addresses = 1;
|
||||||
|
// Pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
}
|
192
proto/wasm/v1/tx.proto
Normal file
192
proto/wasm/v1/tx.proto
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "wasm/v1/types.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
|
||||||
|
// Msg defines the wasm Msg service.
|
||||||
|
service Msg {
|
||||||
|
// StoreCode to submit Wasm code to the system
|
||||||
|
rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);
|
||||||
|
// InstantiateContract creates a new smart contract instance for the given
|
||||||
|
// code id.
|
||||||
|
rpc InstantiateContract(MsgInstantiateContract)
|
||||||
|
returns (MsgInstantiateContractResponse);
|
||||||
|
// InstantiateContract2 creates a new smart contract instance for the given
|
||||||
|
// code id with a predictable address
|
||||||
|
rpc InstantiateContract2(MsgInstantiateContract2)
|
||||||
|
returns (MsgInstantiateContract2Response);
|
||||||
|
// Execute submits the given message data to a smart contract
|
||||||
|
rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse);
|
||||||
|
// Migrate runs a code upgrade/ downgrade for a smart contract
|
||||||
|
rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse);
|
||||||
|
// UpdateAdmin sets a new admin for a smart contract
|
||||||
|
rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse);
|
||||||
|
// ClearAdmin removes any admin stored for a smart contract
|
||||||
|
rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse);
|
||||||
|
// UpdateInstantiateConfig updates instantiate config for a smart contract
|
||||||
|
rpc UpdateInstantiateConfig(MsgUpdateInstantiateConfig)
|
||||||
|
returns (MsgUpdateInstantiateConfigResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgStoreCode submit Wasm code to the system
|
||||||
|
message MsgStoreCode {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// WASMByteCode can be raw or gzip compressed
|
||||||
|
bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ];
|
||||||
|
// Used in v1beta1
|
||||||
|
reserved 3, 4;
|
||||||
|
// InstantiatePermission access control to apply on contract creation,
|
||||||
|
// optional
|
||||||
|
AccessConfig instantiate_permission = 5;
|
||||||
|
}
|
||||||
|
// MsgStoreCodeResponse returns store result data.
|
||||||
|
message MsgStoreCodeResponse {
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Checksum is the sha256 hash of the stored code
|
||||||
|
bytes checksum = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgInstantiateContract create a new smart contract instance for the given
|
||||||
|
// code id.
|
||||||
|
message MsgInstantiateContract {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 2;
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Label is optional metadata to be stored with a contract instance.
|
||||||
|
string label = 4;
|
||||||
|
// Msg json encoded message to be passed to the contract on instantiation
|
||||||
|
bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 6 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgInstantiateContract2 create a new smart contract instance for the given
|
||||||
|
// code id with a predicable address.
|
||||||
|
message MsgInstantiateContract2 {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 2;
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Label is optional metadata to be stored with a contract instance.
|
||||||
|
string label = 4;
|
||||||
|
// Msg json encoded message to be passed to the contract on instantiation
|
||||||
|
bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on instantiation
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 6 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
// Salt is an arbitrary value provided by the sender. Size can be 1 to 64.
|
||||||
|
bytes salt = 7;
|
||||||
|
// FixMsg include the msg value into the hash for the predictable address.
|
||||||
|
// Default is false
|
||||||
|
bool fix_msg = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgInstantiateContractResponse return instantiation result data
|
||||||
|
message MsgInstantiateContractResponse {
|
||||||
|
// Address is the bech32 address of the new contract instance.
|
||||||
|
string address = 1;
|
||||||
|
// Data contains bytes to returned from the contract
|
||||||
|
bytes data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgInstantiateContract2Response return instantiation result data
|
||||||
|
message MsgInstantiateContract2Response {
|
||||||
|
// Address is the bech32 address of the new contract instance.
|
||||||
|
string address = 1;
|
||||||
|
// Data contains bytes to returned from the contract
|
||||||
|
bytes data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgExecuteContract submits the given message data to a smart contract
|
||||||
|
message MsgExecuteContract {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 2;
|
||||||
|
// Msg json encoded message to be passed to the contract
|
||||||
|
bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
// Funds coins that are transferred to the contract on execution
|
||||||
|
repeated cosmos.base.v1beta1.Coin funds = 5 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgExecuteContractResponse returns execution result data.
|
||||||
|
message MsgExecuteContractResponse {
|
||||||
|
// Data contains bytes to returned from the contract
|
||||||
|
bytes data = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
|
||||||
|
message MsgMigrateContract {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 2;
|
||||||
|
// CodeID references the new WASM code
|
||||||
|
uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Msg json encoded message to be passed to the contract on migration
|
||||||
|
bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgMigrateContractResponse returns contract migration result data.
|
||||||
|
message MsgMigrateContractResponse {
|
||||||
|
// Data contains same raw bytes returned as data from the wasm contract.
|
||||||
|
// (May be empty)
|
||||||
|
bytes data = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateAdmin sets a new admin for a smart contract
|
||||||
|
message MsgUpdateAdmin {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// NewAdmin address to be set
|
||||||
|
string new_admin = 2;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateAdminResponse returns empty data
|
||||||
|
message MsgUpdateAdminResponse {}
|
||||||
|
|
||||||
|
// MsgClearAdmin removes any admin stored for a smart contract
|
||||||
|
message MsgClearAdmin {
|
||||||
|
// Sender is the actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// Contract is the address of the smart contract
|
||||||
|
string contract = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgClearAdminResponse returns empty data
|
||||||
|
message MsgClearAdminResponse {}
|
||||||
|
|
||||||
|
// MsgUpdateInstantiateConfig updates instantiate config for a smart contract
|
||||||
|
message MsgUpdateInstantiateConfig {
|
||||||
|
// Sender is the that actor that signed the messages
|
||||||
|
string sender = 1;
|
||||||
|
// CodeID references the stored WASM code
|
||||||
|
uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// NewInstantiatePermission is the new access control
|
||||||
|
AccessConfig new_instantiate_permission = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsgUpdateInstantiateConfigResponse returns empty data
|
||||||
|
message MsgUpdateInstantiateConfigResponse {}
|
144
proto/wasm/v1/types.proto
Normal file
144
proto/wasm/v1/types.proto
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
package cosmwasm.wasm.v1;
|
||||||
|
|
||||||
|
import "cosmos_proto/cosmos.proto";
|
||||||
|
import "gogoproto/gogo.proto";
|
||||||
|
import "google/protobuf/any.proto";
|
||||||
|
|
||||||
|
option go_package = "github.com/cerc-io/laconicd/x/wasm/types";
|
||||||
|
option (gogoproto.goproto_getters_all) = false;
|
||||||
|
option (gogoproto.equal_all) = true;
|
||||||
|
|
||||||
|
// AccessType permission types
|
||||||
|
enum AccessType {
|
||||||
|
option (gogoproto.goproto_enum_prefix) = false;
|
||||||
|
option (gogoproto.goproto_enum_stringer) = false;
|
||||||
|
// AccessTypeUnspecified placeholder for empty value
|
||||||
|
ACCESS_TYPE_UNSPECIFIED = 0
|
||||||
|
[ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ];
|
||||||
|
// AccessTypeNobody forbidden
|
||||||
|
ACCESS_TYPE_NOBODY = 1
|
||||||
|
[ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ];
|
||||||
|
// AccessTypeOnlyAddress restricted to a single address
|
||||||
|
// Deprecated: use AccessTypeAnyOfAddresses instead
|
||||||
|
ACCESS_TYPE_ONLY_ADDRESS = 2
|
||||||
|
[ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ];
|
||||||
|
// AccessTypeEverybody unrestricted
|
||||||
|
ACCESS_TYPE_EVERYBODY = 3
|
||||||
|
[ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ];
|
||||||
|
// AccessTypeAnyOfAddresses allow any of the addresses
|
||||||
|
ACCESS_TYPE_ANY_OF_ADDRESSES = 4
|
||||||
|
[ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddresses" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccessTypeParam
|
||||||
|
message AccessTypeParam {
|
||||||
|
option (gogoproto.goproto_stringer) = true;
|
||||||
|
AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccessConfig access control type.
|
||||||
|
message AccessConfig {
|
||||||
|
option (gogoproto.goproto_stringer) = true;
|
||||||
|
AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ];
|
||||||
|
|
||||||
|
// Address
|
||||||
|
// Deprecated: replaced by addresses
|
||||||
|
string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ];
|
||||||
|
repeated string addresses = 3 [ (gogoproto.moretags) = "yaml:\"addresses\"" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Params defines the set of wasm parameters.
|
||||||
|
message Params {
|
||||||
|
option (gogoproto.goproto_stringer) = false;
|
||||||
|
AccessConfig code_upload_access = 1 [
|
||||||
|
(gogoproto.nullable) = false,
|
||||||
|
(gogoproto.moretags) = "yaml:\"code_upload_access\""
|
||||||
|
];
|
||||||
|
AccessType instantiate_default_permission = 2
|
||||||
|
[ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// CodeInfo is data for the uploaded contract WASM code
|
||||||
|
message CodeInfo {
|
||||||
|
// CodeHash is the unique identifier created by wasmvm
|
||||||
|
bytes code_hash = 1;
|
||||||
|
// Creator address who initially stored the code
|
||||||
|
string creator = 2;
|
||||||
|
// Used in v1beta1
|
||||||
|
reserved 3, 4;
|
||||||
|
// InstantiateConfig access control to apply on contract creation, optional
|
||||||
|
AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractInfo stores a WASM contract instance
|
||||||
|
message ContractInfo {
|
||||||
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
|
// CodeID is the reference to the stored Wasm code
|
||||||
|
uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Creator address who initially instantiated the contract
|
||||||
|
string creator = 2;
|
||||||
|
// Admin is an optional address that can execute migrations
|
||||||
|
string admin = 3;
|
||||||
|
// Label is optional metadata to be stored with a contract instance.
|
||||||
|
string label = 4;
|
||||||
|
// Created Tx position when the contract was instantiated.
|
||||||
|
AbsoluteTxPosition created = 5;
|
||||||
|
string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ];
|
||||||
|
|
||||||
|
// Extension is an extension point to store custom metadata within the
|
||||||
|
// persistence model.
|
||||||
|
google.protobuf.Any extension = 7
|
||||||
|
[ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractCodeHistoryOperationType actions that caused a code change
|
||||||
|
enum ContractCodeHistoryOperationType {
|
||||||
|
option (gogoproto.goproto_enum_prefix) = false;
|
||||||
|
// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value
|
||||||
|
CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0
|
||||||
|
[ (gogoproto.enumvalue_customname) =
|
||||||
|
"ContractCodeHistoryOperationTypeUnspecified" ];
|
||||||
|
// ContractCodeHistoryOperationTypeInit on chain contract instantiation
|
||||||
|
CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1
|
||||||
|
[ (gogoproto.enumvalue_customname) =
|
||||||
|
"ContractCodeHistoryOperationTypeInit" ];
|
||||||
|
// ContractCodeHistoryOperationTypeMigrate code migration
|
||||||
|
CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2
|
||||||
|
[ (gogoproto.enumvalue_customname) =
|
||||||
|
"ContractCodeHistoryOperationTypeMigrate" ];
|
||||||
|
// ContractCodeHistoryOperationTypeGenesis based on genesis data
|
||||||
|
CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3
|
||||||
|
[ (gogoproto.enumvalue_customname) =
|
||||||
|
"ContractCodeHistoryOperationTypeGenesis" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContractCodeHistoryEntry metadata to a contract.
|
||||||
|
message ContractCodeHistoryEntry {
|
||||||
|
ContractCodeHistoryOperationType operation = 1;
|
||||||
|
// CodeID is the reference to the stored WASM code
|
||||||
|
uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ];
|
||||||
|
// Updated Tx position when the operation was executed.
|
||||||
|
AbsoluteTxPosition updated = 3;
|
||||||
|
bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// AbsoluteTxPosition is a unique transaction position that allows for global
|
||||||
|
// ordering of transactions.
|
||||||
|
message AbsoluteTxPosition {
|
||||||
|
// BlockHeight is the block the contract was created at
|
||||||
|
uint64 block_height = 1;
|
||||||
|
// TxIndex is a monotonic counter within the block (actual transaction index,
|
||||||
|
// or gas consumed)
|
||||||
|
uint64 tx_index = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Model is a struct that holds a KV pair
|
||||||
|
message Model {
|
||||||
|
// hex-encode key to read it better (this is often ascii)
|
||||||
|
bytes key = 1 [ (gogoproto.casttype) =
|
||||||
|
"github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
|
||||||
|
// base64-encode raw value
|
||||||
|
bytes value = 2;
|
||||||
|
}
|
1805
x/wasm/types/authz.pb.go
generated
Normal file
1805
x/wasm/types/authz.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
1388
x/wasm/types/genesis.pb.go
generated
Normal file
1388
x/wasm/types/genesis.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
592
x/wasm/types/ibc.pb.go
generated
Normal file
592
x/wasm/types/ibc.pb.go
generated
Normal file
@ -0,0 +1,592 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: wasm/v1/ibc.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
math_bits "math/bits"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||||
|
|
||||||
|
// MsgIBCSend
|
||||||
|
type MsgIBCSend struct {
|
||||||
|
// the channel by which the packet will be sent
|
||||||
|
Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty" yaml:"source_channel"`
|
||||||
|
// Timeout height relative to the current block height.
|
||||||
|
// The timeout is disabled when set to 0.
|
||||||
|
TimeoutHeight uint64 `protobuf:"varint,4,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty" yaml:"timeout_height"`
|
||||||
|
// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
|
||||||
|
// The timeout is disabled when set to 0.
|
||||||
|
TimeoutTimestamp uint64 `protobuf:"varint,5,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"`
|
||||||
|
// Data is the payload to transfer. We must not make assumption what format or
|
||||||
|
// content is in here.
|
||||||
|
Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCSend) Reset() { *m = MsgIBCSend{} }
|
||||||
|
func (m *MsgIBCSend) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgIBCSend) ProtoMessage() {}
|
||||||
|
func (*MsgIBCSend) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_9cdfabf504f9c734, []int{0}
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgIBCSend.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgIBCSend.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgIBCSend.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgIBCSend proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// MsgIBCCloseChannel port and channel need to be owned by the contract
|
||||||
|
type MsgIBCCloseChannel struct {
|
||||||
|
Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty" yaml:"source_channel"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCCloseChannel) Reset() { *m = MsgIBCCloseChannel{} }
|
||||||
|
func (m *MsgIBCCloseChannel) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*MsgIBCCloseChannel) ProtoMessage() {}
|
||||||
|
func (*MsgIBCCloseChannel) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_9cdfabf504f9c734, []int{1}
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_MsgIBCCloseChannel.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_MsgIBCCloseChannel.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_MsgIBCCloseChannel.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_MsgIBCCloseChannel proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*MsgIBCSend)(nil), "cosmwasm.wasm.v1.MsgIBCSend")
|
||||||
|
proto.RegisterType((*MsgIBCCloseChannel)(nil), "cosmwasm.wasm.v1.MsgIBCCloseChannel")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("wasm/v1/ibc.proto", fileDescriptor_9cdfabf504f9c734) }
|
||||||
|
|
||||||
|
var fileDescriptor_9cdfabf504f9c734 = []byte{
|
||||||
|
// 306 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x4f, 0x2c, 0xce,
|
||||||
|
0xd5, 0x2f, 0x33, 0xd4, 0xcf, 0x4c, 0x4a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x48,
|
||||||
|
0xce, 0x2f, 0xce, 0x05, 0x09, 0xeb, 0x81, 0x89, 0x32, 0x43, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c,
|
||||||
|
0xb0, 0xa4, 0x3e, 0x88, 0x05, 0x51, 0xa7, 0xf4, 0x88, 0x91, 0x8b, 0xcb, 0xb7, 0x38, 0xdd, 0xd3,
|
||||||
|
0xc9, 0x39, 0x38, 0x35, 0x2f, 0x45, 0xc8, 0x98, 0x8b, 0x3d, 0x39, 0x23, 0x31, 0x2f, 0x2f, 0x35,
|
||||||
|
0x47, 0x82, 0x49, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xf2, 0xd3, 0x3d, 0x79, 0xd1, 0xca, 0xc4, 0xdc,
|
||||||
|
0x1c, 0x2b, 0xa5, 0xe2, 0xfc, 0xd2, 0xa2, 0xe4, 0xd4, 0x78, 0xa8, 0xbc, 0x52, 0x10, 0x4c, 0xa5,
|
||||||
|
0x90, 0x03, 0x17, 0x5f, 0x49, 0x66, 0x6e, 0x6a, 0x7e, 0x69, 0x49, 0x7c, 0x46, 0x6a, 0x66, 0x7a,
|
||||||
|
0x46, 0x89, 0x04, 0x8b, 0x02, 0xa3, 0x06, 0x0b, 0xb2, 0x5e, 0x54, 0x79, 0xa5, 0x20, 0x5e, 0xa8,
|
||||||
|
0x80, 0x07, 0x98, 0x2f, 0xe4, 0xc9, 0x25, 0x08, 0x53, 0x01, 0xa2, 0x8b, 0x4b, 0x12, 0x73, 0x0b,
|
||||||
|
0x24, 0x58, 0xc1, 0x86, 0xc8, 0x7c, 0xba, 0x27, 0x2f, 0x81, 0x6a, 0x08, 0x5c, 0x89, 0x52, 0x90,
|
||||||
|
0x00, 0x54, 0x2c, 0x04, 0x26, 0x24, 0x24, 0xc4, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28, 0xc1, 0xa6,
|
||||||
|
0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x2b, 0x79, 0x72, 0x09, 0x41, 0xfc, 0xe8, 0x9c, 0x93, 0x5f,
|
||||||
|
0x9c, 0xea, 0x0c, 0x75, 0x36, 0x39, 0x7e, 0x75, 0x72, 0x3b, 0xf1, 0x50, 0x8e, 0xe1, 0xc4, 0x23,
|
||||||
|
0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2,
|
||||||
|
0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x34, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4,
|
||||||
|
0x92, 0xf3, 0x73, 0xf5, 0x93, 0x53, 0x8b, 0x92, 0x75, 0x33, 0xf3, 0xf5, 0x73, 0x12, 0x93, 0xf3,
|
||||||
|
0xf3, 0x32, 0x93, 0x53, 0xf4, 0x2b, 0xf4, 0xc1, 0xd1, 0x54, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4,
|
||||||
|
0x06, 0x0e, 0x7e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0x6d, 0x8c, 0xf6, 0xbb, 0x01,
|
||||||
|
0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCSend) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCSend) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCSend) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Data) > 0 {
|
||||||
|
i -= len(m.Data)
|
||||||
|
copy(dAtA[i:], m.Data)
|
||||||
|
i = encodeVarintIbc(dAtA, i, uint64(len(m.Data)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x32
|
||||||
|
}
|
||||||
|
if m.TimeoutTimestamp != 0 {
|
||||||
|
i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutTimestamp))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x28
|
||||||
|
}
|
||||||
|
if m.TimeoutHeight != 0 {
|
||||||
|
i = encodeVarintIbc(dAtA, i, uint64(m.TimeoutHeight))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x20
|
||||||
|
}
|
||||||
|
if len(m.Channel) > 0 {
|
||||||
|
i -= len(m.Channel)
|
||||||
|
copy(dAtA[i:], m.Channel)
|
||||||
|
i = encodeVarintIbc(dAtA, i, uint64(len(m.Channel)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCCloseChannel) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCCloseChannel) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCCloseChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
if len(m.Channel) > 0 {
|
||||||
|
i -= len(m.Channel)
|
||||||
|
copy(dAtA[i:], m.Channel)
|
||||||
|
i = encodeVarintIbc(dAtA, i, uint64(len(m.Channel)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintIbc(dAtA []byte, offset int, v uint64) int {
|
||||||
|
offset -= sovIbc(v)
|
||||||
|
base := offset
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return base
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Channel)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovIbc(uint64(l))
|
||||||
|
}
|
||||||
|
if m.TimeoutHeight != 0 {
|
||||||
|
n += 1 + sovIbc(uint64(m.TimeoutHeight))
|
||||||
|
}
|
||||||
|
if m.TimeoutTimestamp != 0 {
|
||||||
|
n += 1 + sovIbc(uint64(m.TimeoutTimestamp))
|
||||||
|
}
|
||||||
|
l = len(m.Data)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovIbc(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MsgIBCCloseChannel) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.Channel)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovIbc(uint64(l))
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovIbc(x uint64) (n int) {
|
||||||
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
|
}
|
||||||
|
func sozIbc(x uint64) (n int) {
|
||||||
|
return sovIbc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (m *MsgIBCSend) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgIBCSend: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgIBCSend: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Channel = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType)
|
||||||
|
}
|
||||||
|
m.TimeoutHeight = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.TimeoutHeight |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType)
|
||||||
|
}
|
||||||
|
m.TimeoutTimestamp = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.TimeoutTimestamp |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 6:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
||||||
|
}
|
||||||
|
var byteLen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
byteLen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if byteLen < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
|
||||||
|
if m.Data == nil {
|
||||||
|
m.Data = []byte{}
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipIbc(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *MsgIBCCloseChannel) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: MsgIBCCloseChannel: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: MsgIBCCloseChannel: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.Channel = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipIbc(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||||
|
return ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipIbc(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
depth := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowIbc
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
return 0, ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
iNdEx += length
|
||||||
|
case 3:
|
||||||
|
depth++
|
||||||
|
case 4:
|
||||||
|
if depth == 0 {
|
||||||
|
return 0, ErrUnexpectedEndOfGroupIbc
|
||||||
|
}
|
||||||
|
depth--
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthIbc
|
||||||
|
}
|
||||||
|
if depth == 0 {
|
||||||
|
return iNdEx, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthIbc = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowIbc = fmt.Errorf("proto: integer overflow")
|
||||||
|
ErrUnexpectedEndOfGroupIbc = fmt.Errorf("proto: unexpected end of group")
|
||||||
|
)
|
5697
x/wasm/types/proposal.pb.go
generated
Normal file
5697
x/wasm/types/proposal.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
5481
x/wasm/types/query.pb.go
generated
Normal file
5481
x/wasm/types/query.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
1243
x/wasm/types/query.pb.gw.go
generated
Normal file
1243
x/wasm/types/query.pb.gw.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
4304
x/wasm/types/tx.pb.go
generated
Normal file
4304
x/wasm/types/tx.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
2483
x/wasm/types/types.pb.go
generated
Normal file
2483
x/wasm/types/types.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user