Stride-Labs/stride

Lack of check exist of acctAddress in mint module

Opened this issue · 2 comments

Background

SetupNewModuleAccount function doesn't have a check if the acctAddress is exist

func (k Keeper) SetupNewModuleAccount(ctx sdk.Context, submoduleName string, submoduleNamespace string) {
// create and save the module account to the account keeper
acctAddress := k.GetSubmoduleAddress(submoduleName, submoduleNamespace)
acc := k.accountKeeper.NewAccount(
ctx,
authtypes.NewModuleAccount(
authtypes.NewBaseAccountWithAddress(acctAddress),
acctAddress.String(),
),
)

so in some cases, we can face some problems with this, I have run simulation for this and face it

Suggested Design

  • Add a check if the acctAddress is exist

Acceptance Criteria

  • Check for existing of acctAddress was added
  • All test pass

Can you elaborate on

so in some cases, we can face some problems with this, I have run simulation for this and face it

I don't understand what will break in this case?

Also, if you are running simulation tests, could you share your code for that? We'd like to start using them.

Sure @riley-stride, I coding simulation test for Strid, and will update information of fail soon in the pr of this issue