From 1ecad2d13ec38378eceebeec708533b95ea46b97 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Thu, 7 Dec 2023 01:15:37 -0600 Subject: [PATCH] fix: broken unit test + make x/sudo safer by making blank genesis invalid --- CHANGELOG.md | 1 + proto/nibiru/inflation/v1/event.proto | 32 +++++++-------- x/common/testutil/testapp/testapp.go | 9 ++++ x/inflation/keeper/inflation.go | 24 +++++------ x/inflation/keeper/inflation_test.go | 21 +++++++--- x/inflation/types/event.pb.go | 59 ++++++++++++++------------- x/inflation/types/interfaces.go | 2 +- x/sudo/genesis.go | 2 + x/sudo/keeper/keeper.go | 2 +- x/sudo/keeper/msg_server_test.go | 12 +----- x/sudo/types/errors.go | 19 ++++++++- x/sudo/types/genesis.go | 5 +-- x/sudo/types/state.go | 5 ++- x/sudo/types/state.pb.go | 2 +- 14 files changed, 114 insertions(+), 81 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6a3c22db..9ec050516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1690](https://github.com/NibiruChain/nibiru/pull/1690) - docs(CHANGELOG.md): Correct the change log, providing clarity on what's released. * [#1679](https://github.com/NibiruChain/nibiru/pull/1679) - test(perp): add more tests for perp module msg server * [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - feat(inflation): add events for inflation distribution +* [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - fix(sudo): Make blank sudoers root invalid at genesis time. ### Dependencies diff --git a/proto/nibiru/inflation/v1/event.proto b/proto/nibiru/inflation/v1/event.proto index 2c9b677cf..ef321ee22 100644 --- a/proto/nibiru/inflation/v1/event.proto +++ b/proto/nibiru/inflation/v1/event.proto @@ -6,21 +6,21 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/NibiruChain/nibiru/x/inflation/types"; -// Emitted when inflation is distributed -message InflationDistributionEvent { - cosmos.base.v1beta1.Coin staking_rewards = 1 [ - (gogoproto.moretags) = "yaml:\"staking_rewards\"", - (gogoproto.nullable)= false - ]; +// EventInflationDistribution: Emitted when NIBI tokens are minted on the +// network based on Nibiru's inflation schedule. +message EventInflationDistribution { + cosmos.base.v1beta1.Coin staking_rewards = 1 [ + (gogoproto.moretags) = "yaml:\"staking_rewards\"", + (gogoproto.nullable) = false + ]; - cosmos.base.v1beta1.Coin strategic_reserve = 2 [ - (gogoproto.moretags) = "yaml:\"strategic_reserve\"", - (gogoproto.nullable)= false - ]; + cosmos.base.v1beta1.Coin strategic_reserve = 2 [ + (gogoproto.moretags) = "yaml:\"strategic_reserve\"", + (gogoproto.nullable) = false + ]; - cosmos.base.v1beta1.Coin community_pool = 3 [ - (gogoproto.moretags) = "yaml:\"community_pool\"", - (gogoproto.nullable)= false - ]; - -} \ No newline at end of file + cosmos.base.v1beta1.Coin community_pool = 3 [ + (gogoproto.moretags) = "yaml:\"community_pool\"", + (gogoproto.nullable) = false + ]; +} diff --git a/x/common/testutil/testapp/testapp.go b/x/common/testutil/testapp/testapp.go index 6826da359..fe9d5b577 100644 --- a/x/common/testutil/testapp/testapp.go +++ b/x/common/testutil/testapp/testapp.go @@ -32,9 +32,18 @@ func NewNibiruTestAppAndContext() (*app.NibiruApp, sdk.Context) { encoding := app.MakeEncodingConfig() var appGenesis app.GenesisState = app.NewDefaultGenesisState(encoding.Marshaler) genModEpochs := epochstypes.DefaultGenesisFromTime(time.Now().UTC()) + + // Set happy genesis: epochs appGenesis[epochstypes.ModuleName] = encoding.Marshaler.MustMarshalJSON( genModEpochs, ) + + // Set happy genesis: sudo + sudoGenesis := new(sudotypes.GenesisState) + sudoGenesis.Sudoers = DefaultSudoers() + appGenesis[sudotypes.ModuleName] = + encoding.Marshaler.MustMarshalJSON(sudoGenesis) + app := NewNibiruTestApp(appGenesis) ctx := NewContext(app) diff --git a/x/inflation/keeper/inflation.go b/x/inflation/keeper/inflation.go index 9095960ac..6377db6f8 100644 --- a/x/inflation/keeper/inflation.go +++ b/x/inflation/keeper/inflation.go @@ -1,6 +1,8 @@ package keeper import ( + "fmt" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -76,30 +78,28 @@ func (k Keeper) AllocatePolynomialInflation( return sdk.Coin{}, sdk.Coin{}, sdk.Coin{}, err } - // Remaining balance is strategic reserve allocation to the root account of the x/sudo module + // Remaining balance is strategic reserve allocation to the root account + // of the x/sudo module strategic = k.bankKeeper.GetBalance(ctx, inflationModuleAddr, denoms.NIBI) - strategicAccountAddr, err := k.sudoKeeper.GetRoot(ctx) + strategicAccountAddr, err := k.sudoKeeper.GetRootAddr(ctx) if err != nil { - k.Logger(ctx).Error("get root account error", "error", err) + err := fmt.Errorf("inflation error: failed to get sudo root account: %w", err) + k.Logger(ctx).Error(err.Error()) return staking, strategic, community, err } if err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, strategicAccountAddr, sdk.NewCoins(strategic)); err != nil { - k.Logger(ctx).Error("send coins to root account error", "error", err) + err := fmt.Errorf("inflation error: failed to send coins to sudo root account: %w", err) + k.Logger(ctx).Error(err.Error()) return sdk.Coin{}, sdk.Coin{}, sdk.Coin{}, err } - if err := ctx.EventManager().EmitTypedEvents( - &types.InflationDistributionEvent{ + return staking, strategic, community, ctx.EventManager().EmitTypedEvents( + &types.EventInflationDistribution{ StakingRewards: staking, StrategicReserve: strategic, CommunityPool: community, - }, - ); err != nil { - return sdk.Coin{}, sdk.Coin{}, sdk.Coin{}, err - } - - return staking, strategic, community, nil + }) } // GetAllocationProportion calculates the proportion of coins that is to be diff --git a/x/inflation/keeper/inflation_test.go b/x/inflation/keeper/inflation_test.go index 083c1f150..5b157d641 100644 --- a/x/inflation/keeper/inflation_test.go +++ b/x/inflation/keeper/inflation_test.go @@ -79,7 +79,12 @@ func TestMintAndAllocateInflation(t *testing.T) { }) staking, strategic, community, err := nibiruApp.InflationKeeper.MintAndAllocateInflation(ctx, tc.coinsToMint, types.DefaultParams()) - require.NoError(t, err) + if tc.rootAccount != "" { + require.NoError(t, err) + } else { + require.Error(t, err) + return + } assert.Equal(t, tc.expectedStakingAmt, staking) assert.Equal(t, tc.expectedStrategicAmt, strategic) assert.Equal(t, tc.expectedCommunityAmt, community) @@ -87,7 +92,7 @@ func TestMintAndAllocateInflation(t *testing.T) { // Get balances var balanceStrategicReserve sdk.Coin if tc.rootAccount != "" { - strategicAccount, err := nibiruApp.SudoKeeper.GetRoot(ctx) + strategicAccount, err := nibiruApp.SudoKeeper.GetRootAddr(ctx) require.NoError(t, err) balanceStrategicReserve = nibiruApp.BankKeeper.GetBalance( ctx, @@ -108,9 +113,15 @@ func TestMintAndAllocateInflation(t *testing.T) { balanceCommunityPool := nibiruApp.DistrKeeper.GetFeePoolCommunityCoins(ctx) require.NoError(t, err, tc.name) - assert.Equal(t, tc.expectedStakingRewardsBalance, balanceStakingRewards) - assert.Equal(t, tc.expectedStrategicReservesBalance, balanceStrategicReserve) - assert.Equal(t, tc.expectedCommunityPoolBalance, balanceCommunityPool) + assert.Equal(t, + tc.expectedStakingRewardsBalance.String(), + balanceStakingRewards.String()) + assert.Equal(t, + tc.expectedStrategicReservesBalance.String(), + balanceStrategicReserve.String()) + assert.Equal(t, + tc.expectedCommunityPoolBalance.String(), + balanceCommunityPool.String()) }) } } diff --git a/x/inflation/types/event.pb.go b/x/inflation/types/event.pb.go index caac17c35..c5fd42816 100644 --- a/x/inflation/types/event.pb.go +++ b/x/inflation/types/event.pb.go @@ -24,25 +24,26 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Emitted when inflation is distributed -type InflationDistributionEvent struct { +// EventInflationDistribution: Emitted when NIBI tokens are minted on the +// network based on Nibiru's inflation schedule. +type EventInflationDistribution struct { StakingRewards types.Coin `protobuf:"bytes,1,opt,name=staking_rewards,json=stakingRewards,proto3" json:"staking_rewards" yaml:"staking_rewards"` StrategicReserve types.Coin `protobuf:"bytes,2,opt,name=strategic_reserve,json=strategicReserve,proto3" json:"strategic_reserve" yaml:"strategic_reserve"` CommunityPool types.Coin `protobuf:"bytes,3,opt,name=community_pool,json=communityPool,proto3" json:"community_pool" yaml:"community_pool"` } -func (m *InflationDistributionEvent) Reset() { *m = InflationDistributionEvent{} } -func (m *InflationDistributionEvent) String() string { return proto.CompactTextString(m) } -func (*InflationDistributionEvent) ProtoMessage() {} -func (*InflationDistributionEvent) Descriptor() ([]byte, []int) { +func (m *EventInflationDistribution) Reset() { *m = EventInflationDistribution{} } +func (m *EventInflationDistribution) String() string { return proto.CompactTextString(m) } +func (*EventInflationDistribution) ProtoMessage() {} +func (*EventInflationDistribution) Descriptor() ([]byte, []int) { return fileDescriptor_18fa0385facaf5d9, []int{0} } -func (m *InflationDistributionEvent) XXX_Unmarshal(b []byte) error { +func (m *EventInflationDistribution) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *InflationDistributionEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EventInflationDistribution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_InflationDistributionEvent.Marshal(b, m, deterministic) + return xxx_messageInfo_EventInflationDistribution.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -52,33 +53,33 @@ func (m *InflationDistributionEvent) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *InflationDistributionEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_InflationDistributionEvent.Merge(m, src) +func (m *EventInflationDistribution) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventInflationDistribution.Merge(m, src) } -func (m *InflationDistributionEvent) XXX_Size() int { +func (m *EventInflationDistribution) XXX_Size() int { return m.Size() } -func (m *InflationDistributionEvent) XXX_DiscardUnknown() { - xxx_messageInfo_InflationDistributionEvent.DiscardUnknown(m) +func (m *EventInflationDistribution) XXX_DiscardUnknown() { + xxx_messageInfo_EventInflationDistribution.DiscardUnknown(m) } -var xxx_messageInfo_InflationDistributionEvent proto.InternalMessageInfo +var xxx_messageInfo_EventInflationDistribution proto.InternalMessageInfo -func (m *InflationDistributionEvent) GetStakingRewards() types.Coin { +func (m *EventInflationDistribution) GetStakingRewards() types.Coin { if m != nil { return m.StakingRewards } return types.Coin{} } -func (m *InflationDistributionEvent) GetStrategicReserve() types.Coin { +func (m *EventInflationDistribution) GetStrategicReserve() types.Coin { if m != nil { return m.StrategicReserve } return types.Coin{} } -func (m *InflationDistributionEvent) GetCommunityPool() types.Coin { +func (m *EventInflationDistribution) GetCommunityPool() types.Coin { if m != nil { return m.CommunityPool } @@ -86,7 +87,7 @@ func (m *InflationDistributionEvent) GetCommunityPool() types.Coin { } func init() { - proto.RegisterType((*InflationDistributionEvent)(nil), "nibiru.inflation.v1.InflationDistributionEvent") + proto.RegisterType((*EventInflationDistribution)(nil), "nibiru.inflation.v1.EventInflationDistribution") } func init() { proto.RegisterFile("nibiru/inflation/v1/event.proto", fileDescriptor_18fa0385facaf5d9) } @@ -101,8 +102,8 @@ var fileDescriptor_18fa0385facaf5d9 = []byte{ 0x82, 0x09, 0x55, 0x12, 0x21, 0x9f, 0x73, 0x6a, 0x04, 0x48, 0x52, 0x45, 0x84, 0x57, 0x5c, 0x1a, 0x3c, 0x56, 0x60, 0xc0, 0x3f, 0xb6, 0x07, 0x78, 0x73, 0x80, 0xab, 0xa8, 0x73, 0x92, 0x41, 0x06, 0xab, 0x3d, 0xa9, 0x27, 0x7b, 0xda, 0x41, 0x29, 0xe8, 0x02, 0x34, 0x61, 0x54, 0x73, 0x52, 0x45, - 0x8c, 0x1b, 0x1a, 0x91, 0x14, 0x84, 0xb4, 0xfb, 0xf0, 0xa3, 0xe5, 0x75, 0x86, 0x6b, 0xcc, 0xad, - 0xd0, 0x46, 0x09, 0x56, 0xd6, 0xf3, 0x5d, 0xed, 0xf3, 0x99, 0x77, 0xa0, 0x0d, 0x7d, 0x11, 0x32, + 0x8c, 0x1b, 0x1a, 0x91, 0x14, 0x84, 0xb4, 0xfb, 0xf0, 0xa3, 0xe5, 0x75, 0xee, 0x6a, 0xf4, 0x70, + 0xcd, 0xba, 0x15, 0xda, 0x28, 0xc1, 0xca, 0x7a, 0xf6, 0x99, 0x77, 0xa0, 0x0d, 0x7d, 0x11, 0x32, 0x4b, 0x14, 0x7f, 0xa5, 0xea, 0x49, 0x07, 0x6e, 0xcf, 0xbd, 0xdc, 0xbb, 0x3a, 0xc7, 0x16, 0x8c, 0x6b, 0x30, 0x6e, 0xc0, 0x78, 0x00, 0x42, 0xf6, 0xd1, 0x74, 0xde, 0x75, 0xbe, 0xe7, 0xdd, 0xb3, 0x09, 0x2d, 0xf2, 0x9b, 0x70, 0xeb, 0x3f, 0x8c, 0xdb, 0x4d, 0x12, 0xdb, 0xc0, 0x1f, 0x79, 0x47, @@ -113,10 +114,10 @@ var fileDescriptor_18fa0385facaf5d9 = []byte{ 0x5b, 0x20, 0xf7, 0x6b, 0x81, 0xdc, 0xf7, 0x25, 0x72, 0x66, 0x4b, 0xe4, 0x7c, 0x2e, 0x91, 0xf3, 0x48, 0x32, 0x61, 0x46, 0x25, 0xc3, 0x29, 0x14, 0xe4, 0x7e, 0xd5, 0xde, 0x60, 0x44, 0x85, 0x24, 0x4d, 0xd5, 0x6f, 0xbf, 0xca, 0x36, 0x93, 0x31, 0xd7, 0xec, 0xff, 0xaa, 0x9f, 0xeb, 0x9f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x35, 0xa9, 0x99, 0x26, 0x0d, 0x02, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x2c, 0x97, 0xd4, 0x83, 0x0d, 0x02, 0x00, 0x00, } -func (m *InflationDistributionEvent) Marshal() (dAtA []byte, err error) { +func (m *EventInflationDistribution) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -126,12 +127,12 @@ func (m *InflationDistributionEvent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *InflationDistributionEvent) MarshalTo(dAtA []byte) (int, error) { +func (m *EventInflationDistribution) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *InflationDistributionEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EventInflationDistribution) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -180,7 +181,7 @@ func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *InflationDistributionEvent) Size() (n int) { +func (m *EventInflationDistribution) Size() (n int) { if m == nil { return 0 } @@ -201,7 +202,7 @@ func sovEvent(x uint64) (n int) { func sozEvent(x uint64) (n int) { return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *InflationDistributionEvent) Unmarshal(dAtA []byte) error { +func (m *EventInflationDistribution) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -224,10 +225,10 @@ func (m *InflationDistributionEvent) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InflationDistributionEvent: wiretype end group for non-group") + return fmt.Errorf("proto: EventInflationDistribution: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InflationDistributionEvent: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EventInflationDistribution: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/inflation/types/interfaces.go b/x/inflation/types/interfaces.go index 17b3a362e..4a9f0bb01 100644 --- a/x/inflation/types/interfaces.go +++ b/x/inflation/types/interfaces.go @@ -41,5 +41,5 @@ type StakingKeeper interface { } type SudoKeeper interface { - GetRoot(ctx sdk.Context) (sdk.AccAddress, error) + GetRootAddr(ctx sdk.Context) (sdk.AccAddress, error) } diff --git a/x/sudo/genesis.go b/x/sudo/genesis.go index d43690d5b..9feb94e8d 100644 --- a/x/sudo/genesis.go +++ b/x/sudo/genesis.go @@ -28,6 +28,8 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { } } +// DefaultGenesis: A blank genesis state. The DefaultGenesis is invalid because +// it does not specify a "Sudoers.Root". func DefaultGenesis() *types.GenesisState { return &types.GenesisState{ Sudoers: types.Sudoers{ diff --git a/x/sudo/keeper/keeper.go b/x/sudo/keeper/keeper.go index 7dc623058..e7474b0ee 100644 --- a/x/sudo/keeper/keeper.go +++ b/x/sudo/keeper/keeper.go @@ -27,7 +27,7 @@ func NewKeeper( } // Returns the root address of the sudo module. -func (k Keeper) GetRoot(ctx sdk.Context) (sdk.AccAddress, error) { +func (k Keeper) GetRootAddr(ctx sdk.Context) (sdk.AccAddress, error) { sudoers, err := k.Sudoers.Get(ctx) if err != nil { return nil, err diff --git a/x/sudo/keeper/msg_server_test.go b/x/sudo/keeper/msg_server_test.go index c3ed126cf..5c2d24d31 100644 --- a/x/sudo/keeper/msg_server_test.go +++ b/x/sudo/keeper/msg_server_test.go @@ -8,7 +8,6 @@ import ( "github.com/NibiruChain/nibiru/x/sudo/types" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -25,14 +24,7 @@ func init() { } func setup() (*app.NibiruApp, sdk.Context) { - genState := app.NewDefaultGenesisState(app.MakeEncodingConfig().Marshaler) - nibiru := testapp.NewNibiruTestApp(genState) - ctx := nibiru.NewContext(false, tmproto.Header{ - Height: 1, - ChainID: "nibiru-sudonet-1", - Time: time.Now().UTC(), - }) - return nibiru, ctx + return testapp.NewNibiruTestAppAndContextAtTime(time.Now().UTC()) } func TestGenesis(t *testing.T) { @@ -45,7 +37,7 @@ func TestGenesis(t *testing.T) { { name: "default genesis (empty)", genState: sudo.DefaultGenesis(), - empty: true, + panic: true, }, { name: "happy genesis with contracts", diff --git a/x/sudo/types/errors.go b/x/sudo/types/errors.go index 54dfa8798..1dc074c0a 100644 --- a/x/sudo/types/errors.go +++ b/x/sudo/types/errors.go @@ -1,5 +1,20 @@ package types -import sdkerrors "cosmossdk.io/errors" +import ( + "fmt" -var ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized: missing sudo permissions") + sdkerrors "cosmossdk.io/errors" +) + +var ( + ErrUnauthorized = sdkerrors.Register(ModuleName, 2, "unauthorized: missing sudo permissions") + errGenesis = sdkerrors.Register(ModuleName, 3, "sudo genesis error") + errSudoers = sdkerrors.Register(ModuleName, 4, "sudoers error") +) + +func ErrGenesis(errMsg string) error { + return fmt.Errorf("%s: %s", errGenesis, errMsg) +} +func ErrSudoers(errMsg string) error { + return fmt.Errorf("%s: %s", errSudoers, errMsg) +} diff --git a/x/sudo/types/genesis.go b/x/sudo/types/genesis.go index fffb4d2e2..02c0736c9 100644 --- a/x/sudo/types/genesis.go +++ b/x/sudo/types/genesis.go @@ -2,16 +2,15 @@ package types import ( "encoding/json" - "fmt" "github.com/cosmos/cosmos-sdk/codec" ) func (gen *GenesisState) Validate() error { if gen.Sudoers.Contracts == nil { - return fmt.Errorf("nil contract state must be []string") + return ErrGenesis("nil contract state must be []string") } else if err := gen.Sudoers.Validate(); err != nil { - return err + return ErrGenesis(err.Error()) } return nil } diff --git a/x/sudo/types/state.go b/x/sudo/types/state.go index 426fd2103..94128577e 100644 --- a/x/sudo/types/state.go +++ b/x/sudo/types/state.go @@ -7,9 +7,12 @@ import ( ) func (sudo Sudoers) Validate() error { + if _, err := sdk.AccAddressFromBech32(sudo.Root); err != nil { + return ErrSudoers("root addr: " + err.Error()) + } for _, contract := range sudo.Contracts { if _, err := sdk.AccAddressFromBech32(contract); err != nil { - return err + return ErrSudoers("contract addr: " + err.Error()) } } return nil diff --git a/x/sudo/types/state.pb.go b/x/sudo/types/state.pb.go index 99b71715a..033a1c4b9 100644 --- a/x/sudo/types/state.pb.go +++ b/x/sudo/types/state.pb.go @@ -63,7 +63,7 @@ func (m *Sudoers) XXX_DiscardUnknown() { var xxx_messageInfo_Sudoers proto.InternalMessageInfo -func (m *Sudoers) GetRoot() string { +func (m *Sudoers) GetRootAddr() string { if m != nil { return m.Root }