Skip to content

Commit fedb873

Browse files
authored
Merge pull request #3 from provenance-io/fix/wasmd-protos
Fix wasmd protos
2 parents 4e25e51 + 78bf0c8 commit fedb873

12 files changed

Lines changed: 583 additions & 508 deletions

File tree

pb-proto-java/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ val downloadWasmProtos = tasks.create<Download>("downloadWasmProtos") {
9292
val downloadAndUntarWasmdProtos = tasks.create<Copy>("downloadAndUntarWasmdProtos") {
9393
dependsOn(downloadWasmProtos)
9494
from(tarTree(downloadWasmProtos.dest)) {
95-
include("**/x/wasm/internal/types/*.proto")
95+
include("**/proto/cosmwasm/wasm/v1/*.proto")
9696
eachFile {
97-
relativePath = RelativePath(true, "proto", *relativePath.segments.drop(1).toTypedArray())
97+
relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray())
9898
}
9999
includeEmptyDirs = false
100100
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
syntax = "proto3";
2+
package cosmwasm.wasm.v1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "cosmwasm/wasm/v1/types.proto";
6+
import "cosmwasm/wasm/v1/tx.proto";
7+
8+
option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
9+
10+
// GenesisState - genesis state of x/wasm
11+
message GenesisState {
12+
Params params = 1 [ (gogoproto.nullable) = false ];
13+
repeated Code codes = 2
14+
[ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ];
15+
repeated Contract contracts = 3 [
16+
(gogoproto.nullable) = false,
17+
(gogoproto.jsontag) = "contracts,omitempty"
18+
];
19+
repeated Sequence sequences = 4 [
20+
(gogoproto.nullable) = false,
21+
(gogoproto.jsontag) = "sequences,omitempty"
22+
];
23+
repeated GenMsgs gen_msgs = 5 [
24+
(gogoproto.nullable) = false,
25+
(gogoproto.jsontag) = "gen_msgs,omitempty"
26+
];
27+
28+
// GenMsgs define the messages that can be executed during genesis phase in
29+
// order. The intention is to have more human readable data that is auditable.
30+
message GenMsgs {
31+
// sum is a single message
32+
oneof sum {
33+
MsgStoreCode store_code = 1;
34+
MsgInstantiateContract instantiate_contract = 2;
35+
MsgExecuteContract execute_contract = 3;
36+
}
37+
}
38+
}
39+
40+
// Code struct encompasses CodeInfo and CodeBytes
41+
message Code {
42+
uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ];
43+
CodeInfo code_info = 2 [ (gogoproto.nullable) = false ];
44+
bytes code_bytes = 3;
45+
// Pinned to wasmvm cache
46+
bool pinned = 4;
47+
}
48+
49+
// Contract struct encompasses ContractAddress, ContractInfo, and ContractState
50+
message Contract {
51+
string contract_address = 1;
52+
ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ];
53+
repeated Model contract_state = 3 [ (gogoproto.nullable) = false ];
54+
}
55+
56+
// Sequence key and value of an id generation counter
57+
message Sequence {
58+
bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ];
59+
uint64 value = 2;
60+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
syntax = "proto3";
2+
package cosmwasm.wasm.v1;
3+
4+
import "gogoproto/gogo.proto";
5+
6+
option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
7+
option (gogoproto.goproto_getters_all) = false;
8+
9+
// MsgIBCSend
10+
message MsgIBCSend {
11+
// the channel by which the packet will be sent
12+
string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
13+
14+
// Timeout height relative to the current block height.
15+
// The timeout is disabled when set to 0.
16+
uint64 timeout_height = 4
17+
[ (gogoproto.moretags) = "yaml:\"timeout_height\"" ];
18+
// Timeout timestamp (in nanoseconds) relative to the current block timestamp.
19+
// The timeout is disabled when set to 0.
20+
uint64 timeout_timestamp = 5
21+
[ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ];
22+
23+
// data is the payload to transfer
24+
bytes data = 6 [ (gogoproto.casttype) = "encoding/json.RawMessage" ];
25+
}
26+
27+
// MsgIBCCloseChannel port and channel need to be owned by the contract
28+
message MsgIBCCloseChannel {
29+
string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ];
30+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
syntax = "proto3";
2+
package cosmwasm.wasm.v1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "cosmos/base/v1beta1/coin.proto";
6+
import "cosmwasm/wasm/v1/types.proto";
7+
8+
option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
9+
option (gogoproto.goproto_stringer_all) = false;
10+
option (gogoproto.goproto_getters_all) = false;
11+
option (gogoproto.equal_all) = true;
12+
13+
// StoreCodeProposal gov proposal content type to submit WASM code to the system
14+
message StoreCodeProposal {
15+
// Title is a short summary
16+
string title = 1;
17+
// Description is a human readable text
18+
string description = 2;
19+
// RunAs is the address that is passed to the contract's environment as sender
20+
string run_as = 3;
21+
// WASMByteCode can be raw or gzip compressed
22+
bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ];
23+
// Used in v1beta1
24+
reserved 5, 6;
25+
// InstantiatePermission to apply on contract creation, optional
26+
AccessConfig instantiate_permission = 7;
27+
}
28+
29+
// InstantiateContractProposal gov proposal content type to instantiate a
30+
// contract.
31+
message InstantiateContractProposal {
32+
// Title is a short summary
33+
string title = 1;
34+
// Description is a human readable text
35+
string description = 2;
36+
// RunAs is the address that is passed to the contract's environment as sender
37+
string run_as = 3;
38+
// Admin is an optional address that can execute migrations
39+
string admin = 4;
40+
// CodeID is the reference to the stored WASM code
41+
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
42+
// Label is optional metadata to be stored with a constract instance.
43+
string label = 6;
44+
// Msg json encoded message to be passed to the contract on instantiation
45+
bytes msg = 7;
46+
// Funds coins that are transferred to the contract on instantiation
47+
repeated cosmos.base.v1beta1.Coin funds = 8 [
48+
(gogoproto.nullable) = false,
49+
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
50+
];
51+
}
52+
53+
// MigrateContractProposal gov proposal content type to migrate a contract.
54+
message MigrateContractProposal {
55+
// Title is a short summary
56+
string title = 1;
57+
// Description is a human readable text
58+
string description = 2;
59+
// RunAs is the address that is passed to the contract's environment as sender
60+
string run_as = 3;
61+
// Contract is the address of the smart contract
62+
string contract = 4;
63+
// CodeID references the new WASM code
64+
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
65+
// Msg json encoded message to be passed to the contract on migration
66+
bytes msg = 6;
67+
}
68+
69+
// UpdateAdminProposal gov proposal content type to set an admin for a contract.
70+
message UpdateAdminProposal {
71+
// Title is a short summary
72+
string title = 1;
73+
// Description is a human readable text
74+
string description = 2;
75+
// NewAdmin address to be set
76+
string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
77+
// Contract is the address of the smart contract
78+
string contract = 4;
79+
}
80+
81+
// ClearAdminProposal gov proposal content type to clear the admin of a
82+
// contract.
83+
message ClearAdminProposal {
84+
// Title is a short summary
85+
string title = 1;
86+
// Description is a human readable text
87+
string description = 2;
88+
// Contract is the address of the smart contract
89+
string contract = 3;
90+
}
91+
92+
// PinCodesProposal gov proposal content type to pin a set of code ids in the
93+
// wasmvm cache.
94+
message PinCodesProposal {
95+
// Title is a short summary
96+
string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
97+
// Description is a human readable text
98+
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
99+
// CodeIDs references the new WASM codes
100+
repeated uint64 code_ids = 3 [
101+
(gogoproto.customname) = "CodeIDs",
102+
(gogoproto.moretags) = "yaml:\"code_ids\""
103+
];
104+
}
105+
106+
// UnpinCodesProposal gov proposal content type to unpin a set of code ids in
107+
// the wasmvm cache.
108+
message UnpinCodesProposal {
109+
// Title is a short summary
110+
string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ];
111+
// Description is a human readable text
112+
string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ];
113+
// CodeIDs references the WASM codes
114+
repeated uint64 code_ids = 3 [
115+
(gogoproto.customname) = "CodeIDs",
116+
(gogoproto.moretags) = "yaml:\"code_ids\""
117+
];
118+
}

0 commit comments

Comments
 (0)