Skip to content

Commit

Permalink
fix: has relayer permission (#279)
Browse files Browse the repository at this point in the history
* allow all relayers do relaying if not set specifically

* bump version

* wrap the condition

* bump opinit version
  • Loading branch information
beer-1 authored Oct 7, 2024
1 parent c952688 commit 1415b6b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
vmtypes "github.com/initia-labs/movevm/types"
)

const upgradeName = "0.5.5"
const upgradeName = "0.5.6"

// RegisterUpgradeHandlers returns upgrade handlers
func (app *InitiaApp) RegisterUpgradeHandlers(cfg module.Configurator) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-metrics v0.5.3
github.com/initia-labs/OPinit v0.5.4
github.com/initia-labs/OPinit v0.5.5
// we also need to update `LIBMOVEVM_VERSION` of Dockerfile#9
github.com/initia-labs/movevm v0.5.0
github.com/noble-assets/forwarding/v2 v2.0.0-20240521090705-86712c4c9e43
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/initia-labs/OPinit v0.5.4 h1:5p/YwEsmKdQdlOl6swULHeENvftqaHfm/bpS+h7+zLg=
github.com/initia-labs/OPinit v0.5.4/go.mod h1:lx1amLMszculwPu8ln+btJno38UV28fd2nP7XC88ZeE=
github.com/initia-labs/OPinit v0.5.5 h1:1AxaZ7NXJThIkDBBvIvsU2RZEqXVSW5nEL0ewU0A1bQ=
github.com/initia-labs/OPinit v0.5.5/go.mod h1:lx1amLMszculwPu8ln+btJno38UV28fd2nP7XC88ZeE=
github.com/initia-labs/OPinit/api v0.5.1 h1:zwyJf7HtKJCKvLJ1R9PjVfJO1L+d/jKoeFyT7WTLHFI=
github.com/initia-labs/OPinit/api v0.5.1/go.mod h1:gHK6DEWb3/DqQD5LjKirUx9jilAh2UioXanoQdgqVfU=
github.com/initia-labs/cometbft v0.0.0-20240923045653-ba99eb347236 h1:+HmPQ1uptOe4r5oQHuHMG5zF1F3maNoEba5uiTUMnlk=
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/perm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (k Keeper) HasAdminPermission(ctx context.Context, portID, channelID string
// HasRelayerPermission checks if the relayer has permission to relay packets on the channel.
func (k Keeper) HasRelayerPermission(ctx context.Context, portID, channelID string, relayer sdk.AccAddress) (bool, error) {
permRelayers, err := k.ChannelStates.Get(ctx, collections.Join(portID, channelID))
if err != nil && errors.Is(err, collections.ErrNotFound) {
if (err != nil && errors.Is(err, collections.ErrNotFound)) || (err == nil && len(permRelayers.Relayers) == 0) {
// if no permissioned relayers are set, all relayers are allowed
return true, nil
} else if err != nil {
Expand Down

0 comments on commit 1415b6b

Please sign in to comment.