Skip to content

Commit 30c7b70

Browse files
committed
fix: upgrade the proto definitions
1 parent 6e87541 commit 30c7b70

File tree

4 files changed

+16
-201
lines changed

4 files changed

+16
-201
lines changed

packages/cosmic-swingset/third_party/proto/ibc/core/channel/v1/channel.proto

+7-141
Original file line numberDiff line numberDiff line change
@@ -6,142 +6,6 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types";
66
import "gogoproto/gogo.proto";
77
import "ibc/core/client/v1/client.proto";
88

9-
// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It
10-
// is called by a relayer on Chain A.
11-
message MsgChannelOpenInit {
12-
option (gogoproto.equal) = false;
13-
option (gogoproto.goproto_getters) = false;
14-
15-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
16-
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
17-
Channel channel = 3 [(gogoproto.nullable) = false];
18-
string signer = 4;
19-
}
20-
21-
// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel
22-
// on Chain B.
23-
message MsgChannelOpenTry {
24-
option (gogoproto.equal) = false;
25-
option (gogoproto.goproto_getters) = false;
26-
27-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
28-
string desired_channel_id = 2 [(gogoproto.moretags) = "yaml:\"desired_channel_id\""];
29-
string counterparty_chosen_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_chosen_channel_id\""];
30-
Channel channel = 4 [(gogoproto.nullable) = false];
31-
string counterparty_version = 5 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
32-
bytes proof_init = 6 [(gogoproto.moretags) = "yaml:\"proof_init\""];
33-
ibc.core.client.v1.Height proof_height = 7
34-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
35-
string signer = 8;
36-
}
37-
38-
// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge
39-
// the change of channel state to TRYOPEN on Chain B.
40-
message MsgChannelOpenAck {
41-
option (gogoproto.equal) = false;
42-
option (gogoproto.goproto_getters) = false;
43-
44-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
45-
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
46-
string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""];
47-
string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""];
48-
bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""];
49-
ibc.core.client.v1.Height proof_height = 6
50-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
51-
string signer = 7;
52-
}
53-
54-
// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to
55-
// acknowledge the change of channel state to OPEN on Chain A.
56-
message MsgChannelOpenConfirm {
57-
option (gogoproto.equal) = false;
58-
option (gogoproto.goproto_getters) = false;
59-
60-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
61-
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
62-
bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""];
63-
ibc.core.client.v1.Height proof_height = 4
64-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
65-
string signer = 5;
66-
}
67-
68-
// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A
69-
// to close a channel with Chain B.
70-
message MsgChannelCloseInit {
71-
option (gogoproto.equal) = false;
72-
option (gogoproto.goproto_getters) = false;
73-
74-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
75-
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
76-
string signer = 3;
77-
}
78-
79-
// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B
80-
// to acknowledge the change of channel state to CLOSED on Chain A.
81-
message MsgChannelCloseConfirm {
82-
option (gogoproto.equal) = false;
83-
option (gogoproto.goproto_getters) = false;
84-
85-
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""];
86-
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
87-
bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""];
88-
ibc.core.client.v1.Height proof_height = 4
89-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
90-
string signer = 5;
91-
}
92-
93-
// MsgRecvPacket receives incoming IBC packet
94-
message MsgRecvPacket {
95-
option (gogoproto.equal) = false;
96-
option (gogoproto.goproto_getters) = false;
97-
98-
Packet packet = 1 [(gogoproto.nullable) = false];
99-
bytes proof = 2;
100-
ibc.core.client.v1.Height proof_height = 3
101-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
102-
string signer = 4;
103-
}
104-
105-
// MsgTimeout receives timed-out packet
106-
message MsgTimeout {
107-
option (gogoproto.equal) = false;
108-
option (gogoproto.goproto_getters) = false;
109-
110-
Packet packet = 1 [(gogoproto.nullable) = false];
111-
bytes proof = 2;
112-
ibc.core.client.v1.Height proof_height = 3
113-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
114-
uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
115-
string signer = 5;
116-
}
117-
118-
// MsgTimeoutOnClose timed-out packet upon counterparty channel closure.
119-
message MsgTimeoutOnClose {
120-
option (gogoproto.equal) = false;
121-
option (gogoproto.goproto_getters) = false;
122-
123-
Packet packet = 1 [(gogoproto.nullable) = false];
124-
bytes proof = 2;
125-
bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""];
126-
ibc.core.client.v1.Height proof_height = 4
127-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
128-
uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""];
129-
string signer = 6;
130-
}
131-
132-
// MsgAcknowledgement receives incoming IBC acknowledgement
133-
message MsgAcknowledgement {
134-
option (gogoproto.equal) = false;
135-
option (gogoproto.goproto_getters) = false;
136-
137-
Packet packet = 1 [(gogoproto.nullable) = false];
138-
bytes acknowledgement = 2;
139-
bytes proof = 3;
140-
ibc.core.client.v1.Height proof_height = 4
141-
[(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false];
142-
string signer = 5;
143-
}
144-
1459
// Channel defines pipeline for exactly-once packet delivery between specific
14610
// modules on separate blockchains, which has at least one end capable of
14711
// sending packets and one end capable of receiving packets.
@@ -250,9 +114,11 @@ message Packet {
250114
uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""];
251115
}
252116

253-
// PacketAckCommitment defines the genesis type necessary to retrieve and store
254-
// acknowlegements.
255-
message PacketAckCommitment {
117+
// PacketState defines the generic type necessary to retrieve and store
118+
// packet commitments, acknowledgements, and receipts.
119+
// Caller is responsible for knowing the context necessary to interpret this
120+
// state as a commitment, acknowledgement, or a receipt.
121+
message PacketState {
256122
option (gogoproto.goproto_getters) = false;
257123

258124
// channel port identifier.
@@ -261,8 +127,8 @@ message PacketAckCommitment {
261127
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""];
262128
// packet sequence.
263129
uint64 sequence = 3;
264-
// packet commitment hash.
265-
bytes hash = 4;
130+
// embedded data that represents packet state.
131+
bytes data = 4;
266132
}
267133

268134
// Acknowledgement is the recommended acknowledgement format to be used by

packages/cosmic-swingset/third_party/proto/ibc/core/client/v1/client.proto

+6-56
Original file line numberDiff line numberDiff line change
@@ -48,62 +48,6 @@ message ClientUpdateProposal {
4848
google.protobuf.Any header = 4;
4949
}
5050

51-
// MsgCreateClient defines a message to create an IBC client
52-
message MsgCreateClient {
53-
option (gogoproto.equal) = false;
54-
option (gogoproto.goproto_getters) = false;
55-
56-
// client unique identifier
57-
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
58-
// light client state
59-
google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
60-
// consensus state associated with the client that corresponds to a given
61-
// height.
62-
google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""];
63-
// signer address
64-
string signer = 4;
65-
}
66-
67-
// MsgUpdateClient defines an sdk.Msg to update a IBC client state using
68-
// the given header.
69-
message MsgUpdateClient {
70-
option (gogoproto.equal) = false;
71-
option (gogoproto.goproto_getters) = false;
72-
73-
// client unique identifier
74-
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
75-
// header to update the light client
76-
google.protobuf.Any header = 2;
77-
// signer address
78-
string signer = 3;
79-
}
80-
81-
// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state
82-
message MsgUpgradeClient {
83-
// client unique identifier
84-
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
85-
// upgraded client state
86-
google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""];
87-
// proof that old chain committed to new client
88-
bytes proof_upgrade = 3 [(gogoproto.moretags) = "yaml:\"proof_upgrade\""];
89-
// signer address
90-
string signer = 4;
91-
}
92-
93-
// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for
94-
// light client misbehaviour.
95-
message MsgSubmitMisbehaviour {
96-
option (gogoproto.equal) = false;
97-
option (gogoproto.goproto_getters) = false;
98-
99-
// client unique identifier
100-
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
101-
// misbehaviour used for freezing the light client
102-
google.protobuf.Any misbehaviour = 2;
103-
// signer address
104-
string signer = 3;
105-
}
106-
10751
// Height is a monotonically increasing data type
10852
// that can be compared against another Height for the purposes of updating and
10953
// freezing clients
@@ -122,3 +66,9 @@ message Height {
12266
// the height within the given version
12367
uint64 version_height = 2 [(gogoproto.moretags) = "yaml:\"version_height\""];
12468
}
69+
70+
// Params defines the set of IBC light client parameters.
71+
message Params {
72+
// allowed_clients defines the list of allowed client state types.
73+
repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""];
74+
}

packages/cosmic-swingset/x/swingset/genesis.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ func ValidateGenesis(data *types.GenesisState) error {
1919
}
2020

2121
func DefaultGenesisState() *types.GenesisState {
22-
return &types.GenesisState{
23-
Storage: make(map[string]string),
24-
}
22+
gs := NewGenesisState()
23+
return gs
2524
}
2625

2726
func InitGenesis(ctx sdk.Context, keeper Keeper, data *types.GenesisState) []abci.ValidatorUpdate {

packages/cosmic-swingset/x/swingset/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func handleMsgSendPacket(ctx sdk.Context, keeper Keeper, msg *MsgSendPacket) (*s
139139

140140
type provisionAction struct {
141141
*MsgProvision
142-
Type string `json:"type"` // IBC_EVENT
142+
Type string `json:"type"` // PLEASE_PROVISION
143143
BlockHeight int64 `json:"blockHeight"`
144144
BlockTime int64 `json:"blockTime"`
145145
}

0 commit comments

Comments
 (0)