From e980b6880ca2c578042f4853f1beb1decdca37cb Mon Sep 17 00:00:00 2001 From: Csongor Kiss Date: Sat, 5 Mar 2022 19:23:02 +0000 Subject: [PATCH] Move IsGuardian to validator.go Previously we put it in a generated file, which was not a good idea. --- x/staking/types/staking.pb.go | 6 ------ x/staking/types/validator.go | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index bec159787..618599edb 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -336,12 +336,6 @@ type Validator struct { MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"` } -func (*Validator) IsGuardian() bool { - // TODO(csongor): write logic to work out if this is a guardian - // This will require the staking module to use the wormhole module's state keeper - return true -} - func (m *Validator) Reset() { *m = Validator{} } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index e4dd25dc6..7734c307d 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -167,6 +167,12 @@ func (v Validator) IsBonded() bool { return v.GetStatus() == Bonded } +func (*Validator) IsGuardian() bool { + // TODO(csongor): write logic to work out if this is a guardian + // This will require the staking module to use the wormhole module's state keeper + return true +} + // IsUnbonded checks if the validator status equals Unbonded func (v Validator) IsUnbonded() bool { return v.GetStatus() == Unbonded