From 2ac55ebb1dac3b53fe5eaf06daf757eecbb233e8 Mon Sep 17 00:00:00 2001 From: Aditya Sripal Date: Mon, 6 Aug 2018 15:23:47 -0700 Subject: [PATCH] even better pseudocode --- docs/spec/auth/vesting.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/spec/auth/vesting.md b/docs/spec/auth/vesting.md index 3d2be53c3..3123e1da6 100644 --- a/docs/spec/auth/vesting.md +++ b/docs/spec/auth/vesting.md @@ -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. ```go -if Now < vacc.EndTime: +if Now < vestingAccount.EndTime: // NOTE: SendableCoins may be greater than total coins in account // because coins can be subtracted by staking module // SendableCoins denotes maximum coins allowed to be spent. @@ -73,11 +73,12 @@ if Now < vacc.EndTime: if msg.Amount > SendableCoins then fail // Account fully vested, convert to BaseAccount -else: account = ConvertAccount(account) +else: + account = ConvertAccount(account) // Must still check if account has enough coins, // since SendableCoins does not check this. -if msg.Amount > account.GetCoins() then fail +if msg.Amount > account.GetCoins() then fail // All checks passed, send the coins SendCoins(inputs, outputs)