-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add back CosmWasm wasmd protos (#241)
* Needed for backwards compatibility for now
- Loading branch information
Carolyn Russell
authored
Sep 15, 2021
1 parent
f782f7d
commit 95118e4
Showing
10 changed files
with
740 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
syntax = "proto3"; | ||
package cosmwasm.wasm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmwasm/wasm/v1beta1/types.proto"; | ||
import "cosmwasm/wasm/v1beta1/tx.proto"; | ||
|
||
option go_package = "github.com/CosmWasm/wasmd/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" | ||
]; | ||
repeated GenMsgs gen_msgs = 5 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.jsontag) = "gen_msgs,omitempty" | ||
]; | ||
|
||
// GenMsgs define the messages that can be executed during genesis phase in | ||
// order. The intention is to have more human readable data that is auditable. | ||
message GenMsgs { | ||
// sum is a single message | ||
oneof sum { | ||
MsgStoreCode store_code = 1; | ||
MsgInstantiateContract instantiate_contract = 2; | ||
MsgExecuteContract execute_contract = 3; | ||
} | ||
} | ||
} | ||
|
||
// 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 ]; | ||
} | ||
|
||
// Sequence key and value of an id generation counter | ||
message Sequence { | ||
bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ]; | ||
uint64 value = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
package cosmwasm.wasm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/CosmWasm/wasmd/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 | ||
bytes data = 6 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; | ||
} | ||
|
||
// MsgIBCCloseChannel port and channel need to be owned by the contract | ||
message MsgIBCCloseChannel { | ||
string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
syntax = "proto3"; | ||
package cosmwasm.wasm.v1beta1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/base/v1beta1/coin.proto"; | ||
import "cosmwasm/wasm/v1beta1/types.proto"; | ||
|
||
option go_package = "github.com/CosmWasm/wasmd/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 { | ||
// 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" ]; | ||
// Source is a valid absolute HTTPS URI to the contract's source code, | ||
// optional | ||
string source = 5; | ||
// Builder is a valid docker image name with tag, optional | ||
string builder = 6; | ||
// InstantiatePermission to apply on contract creation, optional | ||
AccessConfig instantiate_permission = 7; | ||
} | ||
|
||
// InstantiateContractProposal gov proposal content type to instantiate a | ||
// contract. | ||
message InstantiateContractProposal { | ||
// 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; | ||
// InitMsg json encoded message to be passed to the contract on instantiation | ||
bytes init_msg = 7; | ||
// 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" | ||
]; | ||
} | ||
|
||
// MigrateContractProposal gov proposal content type to migrate a contract. | ||
message MigrateContractProposal { | ||
// 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; | ||
// CodeID references the new WASM code | ||
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; | ||
// MigrateMsg json encoded message to be passed to the contract on migration | ||
bytes migrate_msg = 6; | ||
} | ||
|
||
// UpdateAdminProposal gov proposal content type to set an admin for a contract. | ||
message UpdateAdminProposal { | ||
// 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 { | ||
// 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 { | ||
// 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 { | ||
// 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\"" | ||
]; | ||
} |
Oops, something went wrong.