Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 26, 2023
1 parent aa55bcd commit 5d86aad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions x/cronos/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ func (k Keeper) RegisterOrUpdateTokenMapping(ctx sdk.Context, msg *types.MsgUpda
return nil
}

// IBCOnAcknowledgementPacketCallback returns nil if the gas meter has greater than
// or equal to 500_000 gas remaining.
// This function oog panics if the gas remaining is less than 500_000.
// This function errors if the authAddress is MockCallbackUnauthorizedAddress.
func (k Keeper) IBCOnAcknowledgementPacketCallback(
ctx sdk.Context,
packet channeltypes.Packet,
Expand All @@ -304,10 +300,6 @@ func (k Keeper) IBCOnAcknowledgementPacketCallback(
return err
}

// IBCOnTimeoutPacketCallback returns nil if the gas meter has greater than
// or equal to 500_000 gas remaining.
// This function oog panics if the gas remaining is less than 500_000.
// This function errors if the authAddress is MockCallbackUnauthorizedAddress.
func (k Keeper) IBCOnTimeoutPacketCallback(
ctx sdk.Context,
packet channeltypes.Packet,
Expand All @@ -317,18 +309,14 @@ func (k Keeper) IBCOnTimeoutPacketCallback(
) error {
relayerAddr := common.BytesToAddress(relayer.Bytes())
precompileAddr := common.HexToAddress(contractAddress)
data, err := cronosprecompiles.GetOnTimeoutPacketCallbackk(packet.Sequence, packetSenderAddress)
data, err := cronosprecompiles.GetOnTimeoutPacketCallback(packet.Sequence, packetSenderAddress)
if err != nil {
return err
}
_, _, err = k.CallEVMWithArgs(ctx, &precompileAddr, relayerAddr, data, big.NewInt(0))
return err
}

// IBCReceivePacketCallback returns nil if the gas meter has greater than
// or equal to 500_000 gas remaining.
// This function oog panics if the gas remaining is less than 500_000.
// This function errors if the authAddress is MockCallbackUnauthorizedAddress.
func (k Keeper) IBCReceivePacketCallback(
ctx sdk.Context,
packet ibcexported.PacketI,
Expand All @@ -338,10 +326,6 @@ func (k Keeper) IBCReceivePacketCallback(
return nil
}

// IBCPacketSendCallback returns nil if the gas meter has greater than
// or equal to 500_000 gas remaining.
// This function oog panics if the gas remaining is less than 500_000.
// This function errors if the authAddress is MockCallbackUnauthorizedAddress.
func (k Keeper) IBCSendPacketCallback(
ctx sdk.Context,
sourcePort string,
Expand Down
2 changes: 1 addition & 1 deletion x/cronos/keeper/precompiles/ica.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func GetOnAcknowledgementPacketCallback(args ...interface{}) ([]byte, error) {
return icaABI.Pack("onAcknowledgementPacketCallback", args...)
}

func GetOnTimeoutPacketCallbackk(args ...interface{}) ([]byte, error) {
func GetOnTimeoutPacketCallback(args ...interface{}) ([]byte, error) {
return icaABI.Pack("onTimeoutPacketCallback", args...)
}

Expand Down

0 comments on commit 5d86aad

Please sign in to comment.