Skip to content

Commit

Permalink
Merge branch 'develop' into dev_stargate_orm
Browse files Browse the repository at this point in the history
* develop:
  Allow export of Liquidity Provider accounts
  Hotfix/v0.9.3 v2 best price in querier response (#40)
  Merge branch 'hotfix/v0.9.3'
  PR for issue 33 (#37)
  Move buildspec.yml to .aws
  • Loading branch information
alpe committed Mar 17, 2021
2 parents b3ce401 + 9c7a966 commit 18e0370
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions x/liquidityprovider/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
)

var _ auth.AccountI = &LiquidityProviderAccount{}
var _ auth.GenesisAccount = &LiquidityProviderAccount{}

func NewLiquidityProviderAccount(account auth.AccountI, mintable sdk.Coins) (*LiquidityProviderAccount, error) {
msg, ok := account.(proto.Message)
Expand All @@ -31,6 +32,19 @@ func NewLiquidityProviderAccount(account auth.AccountI, mintable sdk.Coins) (*Li
}, nil
}

func (acc LiquidityProviderAccount) Validate() error {
if err := acc.Mintable.Validate(); err != nil {
return sdkerrors.Wrap(err, "mintable")
}
type validatable interface {
Validate() error
}
if a, ok := acc.GetNestedAccount().(validatable); ok {
return a.Validate()
}
return nil
}

func (acc *LiquidityProviderAccount) IncreaseMintableAmount(increase sdk.Coins) {
acc.Mintable = acc.Mintable.Add(increase...)
}
Expand Down

0 comments on commit 18e0370

Please sign in to comment.