Skip to content

Commit

Permalink
Update x/accounts/internal/implementation/implementation.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
testinginprod and coderabbitai[bot] authored Nov 2, 2023
1 parent 30cf96b commit fc7ecdc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions x/accounts/internal/implementation/implementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ func MakeAccountsMap(addressCodec address.Codec, accounts []AccountCreatorFunc)
if err != nil {
return nil, fmt.Errorf("failed to create account %s: %w", name, err)
}
if _, ok := accountsMap[name]; ok {
return nil, fmt.Errorf("account %s is already registered", name)
}
// build schema
schema, err := stateSchemaBuilder.Build()
if err != nil {
return nil, fmt.Errorf("failed to build schema for account %s: %w", name, err)
}
impl.CollectionsSchema = schema
// check if account name is already registered
if _, ok := accountsMap[name]; ok {
return nil, fmt.Errorf("account %s is already registered", name)
}
accountsMap[name] = impl
}

Expand Down

0 comments on commit fc7ecdc

Please sign in to comment.