From 25140e4aaef488040c03f52c43df143ae9965019 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Tue, 7 May 2024 19:00:15 +0900 Subject: [PATCH] bridge is always active if there is no guardian --- x/fbridge/keeper/keeper.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x/fbridge/keeper/keeper.go b/x/fbridge/keeper/keeper.go index 7d87a7e979..6bba8eca55 100644 --- a/x/fbridge/keeper/keeper.go +++ b/x/fbridge/keeper/keeper.go @@ -128,10 +128,12 @@ func (k Keeper) GetRoleMetadata(ctx sdk.Context) types.RoleMetadata { } func (k Keeper) GetBridgeStatus(ctx sdk.Context) types.BridgeStatus { - roleMeta := k.GetRoleMetadata(ctx) - bsMeta := k.GetBridgeStatusMetadata(ctx) - if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) { - return types.StatusInactive + if k.GetRoleMetadata(ctx).Guardian != 0 { + roleMeta := k.GetRoleMetadata(ctx) + bsMeta := k.GetBridgeStatusMetadata(ctx) + if types.CheckTrustLevelThreshold(roleMeta.Guardian, bsMeta.Inactive, k.GetParams(ctx).GuardianTrustLevel) { + return types.StatusInactive + } } return types.StatusActive