Skip to content

Commit b6d0a44

Browse files
committed
Check EurekaMsg serialization
1 parent 6cda85e commit b6d0a44

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

types/msg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ type WasmMsg struct {
355355

356356
// These are messages in the IBC lifecycle using the new Eureka approach. Only usable by IBC-enabled contracts
357357
type EurekaMsg struct {
358-
SendPacket *EurekaSendPacketMsg `json:"execute,omitempty"`
358+
SendPacket *EurekaSendPacketMsg `json:"send_packet,omitempty"`
359359
}
360360

361361
// Sends an IBC packet with given payloads over the existing channel.

types/msg_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,18 @@ func TestMsgFundCommunityPoolSerialization(t *testing.T) {
163163
}
164164

165165
func TestMsgEurekaSendPacketSerialization(t *testing.T) {
166-
document := []byte(`{"send_packet":{"amount":[{"amount":"300","denom":"adenom"},{"amount":"400","denom":"bdenom"}]}}`)
166+
document := []byte(`{"send_packet":{"channel_id":"channel-432", "payloads": [{"destination_port": "wasm.123", "version": "random_version", "encoding": "json", "value": ""}], "timeout": "0"}}`)
167167

168168
var msg EurekaMsg
169169
err := json.Unmarshal(document, &msg)
170170
require.NoError(t, err)
171171

172-
require.Equal(t, Array[Coin]{{"adenom", "300"}, {"bdenom", "400"}}, msg.FundCommunityPool.Amount)
172+
require.Equal(t, "channel-432", msg.SendPacket.ChannelID)
173+
require.Equal(t, []EurekaPayload{{
174+
DestinationPort: "wasm.123",
175+
Version: "random_version",
176+
Encoding: "json",
177+
Value: []byte(""),
178+
}}, msg.SendPacket.Payloads)
179+
require.Equal(t, uint64(0), msg.SendPacket.Timeout)
173180
}

0 commit comments

Comments
 (0)