even better pseudocode
This commit is contained in:
parent
d56e3a7ef9
commit
2ac55ebb1d
|
@ -65,7 +65,7 @@ handled at the `bank.Keeper` level. Specifically in methods that are explicitly
|
||||||
`sendCoins` and `inputOutputCoins`. These methods must check that an account is a vesting account using the check described above.
|
`sendCoins` and `inputOutputCoins`. These methods must check that an account is a vesting account using the check described above.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
if Now < vacc.EndTime:
|
if Now < vestingAccount.EndTime:
|
||||||
// NOTE: SendableCoins may be greater than total coins in account
|
// NOTE: SendableCoins may be greater than total coins in account
|
||||||
// because coins can be subtracted by staking module
|
// because coins can be subtracted by staking module
|
||||||
// SendableCoins denotes maximum coins allowed to be spent.
|
// SendableCoins denotes maximum coins allowed to be spent.
|
||||||
|
@ -73,7 +73,8 @@ if Now < vacc.EndTime:
|
||||||
if msg.Amount > SendableCoins then fail
|
if msg.Amount > SendableCoins then fail
|
||||||
|
|
||||||
// Account fully vested, convert to BaseAccount
|
// Account fully vested, convert to BaseAccount
|
||||||
else: account = ConvertAccount(account)
|
else:
|
||||||
|
account = ConvertAccount(account)
|
||||||
|
|
||||||
// Must still check if account has enough coins,
|
// Must still check if account has enough coins,
|
||||||
// since SendableCoins does not check this.
|
// since SendableCoins does not check this.
|
||||||
|
|
Loading…
Reference in New Issue