Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
likesToEatFish committed Jul 22, 2024
1 parent c684f63 commit 0370f42
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion x/meshsecurity/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (k Keeper) SendPackets(ctx sdk.Context) {
k.channelKeeper,
channelID, // source channel id
types.ConsumerPortID, // source port id
s.GetBytes(),
s.MarshalConsumerPacketData(),
k.GetParams(ctx).GetTimeoutPeriod(),
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion x/meshsecurity/keeper/valset_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (k Keeper) ScheduleModified(ctx sdk.Context, addr sdk.ValAddress) error {
func (k Keeper) sendAsync(ctx sdk.Context, op cptypes.PipedValsetOperation, valAddr sdk.ValAddress, packet cptypes.ConsumerPacketData) error {
// if op
ModuleLogger(ctx).Debug("storing for async update", "operation", int(op), "val", valAddr.String())
value := packet.GetBytes()
value := packet.MarshalConsumerPacketData()
ctx.KVStore(k.memKey).Set(types.BuildPipedValsetOpKey(op, valAddr), value)
// and schedule an update callback for all registered contracts
var innerErr error
Expand Down
2 changes: 1 addition & 1 deletion x/types/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/binary"
)

func (c ConsumerPacketData) GetBytes() []byte {
func (c ConsumerPacketData) MarshalConsumerPacketData() []byte {
var bytes []byte
bytes = append(bytes, Int32ToBytes(int32(c.Type))...)
if c.Type != PipedValsetOperation_VALIDATOR_SLASHED {
Expand Down
6 changes: 3 additions & 3 deletions x/types/wire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestGetBytesAndGetData(t *testing.T) {
func TestGetBytesAndUnmarshalConsumerPacketData(t *testing.T) {
c1 := ConsumerPacketData{
Type: PipedValsetOperation_VALIDATOR_SLASHED,
Data: &ConsumerPacketData_SlashPacketData{
Expand All @@ -20,7 +20,7 @@ func TestGetBytesAndGetData(t *testing.T) {
},
}

data := c1.GetBytes()
data := c1.MarshalConsumerPacketData()
c2, err := UnmarshalConsumerPacketData(data)
require.NoError(t, err)
require.Equal(t, c1, c2)
Expand All @@ -40,7 +40,7 @@ func TestGetBytesAndGetData(t *testing.T) {
},
},
}
data = s1.GetBytes()
data = s1.MarshalConsumerPacketData()
s2, err := UnmarshalConsumerPacketData(data)
require.NoError(t, err)
require.Equal(t, s1, s2)
Expand Down

0 comments on commit 0370f42

Please sign in to comment.