Extend ContractInfo for custom data (#492)

* Extend ContractInfo with custom data

* Review comments
This commit is contained in:
Alexander Peters
2021-04-16 13:38:21 +02:00
committed by GitHub
parent 4b8d0247cc
commit d90bf6ec3f
21 changed files with 750 additions and 252 deletions

View File

@@ -67,8 +67,11 @@ message QueryContractInfoResponse {
// address is the address of the contract
string address = 1;
ContractInfo contract_info = 2
[ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ];
ContractInfo contract_info = 2 [
(gogoproto.embed) = true,
(gogoproto.nullable) = false,
(gogoproto.jsontag) = ""
];
}
// QueryContractHistoryRequest is the request type for the Query/ContractHistory
@@ -103,8 +106,11 @@ message ContractInfoWithAddress {
option (gogoproto.equal) = true;
string address = 1;
ContractInfo contract_info = 2
[ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ];
ContractInfo contract_info = 2 [
(gogoproto.embed) = true,
(gogoproto.nullable) = false,
(gogoproto.jsontag) = ""
];
}
// QueryContractsByCodeResponse is the response type for the
// Query/ContractsByCode RPC method

View File

@@ -1,7 +1,9 @@
syntax = "proto3";
package cosmwasm.wasm.v1beta1;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/CosmWasm/wasmd/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;
@@ -83,6 +85,11 @@ message ContractInfo {
// use for sorting
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