This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
forked from steemit/steem
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1071 from GolosChain/1024-implement-payments-for-…
…approved-work Implement payments for approved works #1024
- Loading branch information
Showing
16 changed files
with
231 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include <golos/chain/evaluator.hpp> | ||
|
||
namespace golos { namespace chain { | ||
|
||
asset get_balance(const account_object &account, balance_type type, asset_symbol_type symbol) { | ||
switch(type) { | ||
case MAIN_BALANCE: | ||
switch (symbol) { | ||
case STEEM_SYMBOL: | ||
return account.balance; | ||
case SBD_SYMBOL: | ||
return account.sbd_balance; | ||
default: | ||
GOLOS_CHECK_VALUE(false, "invalid symbol"); | ||
} | ||
case SAVINGS: | ||
switch (symbol) { | ||
case STEEM_SYMBOL: | ||
return account.savings_balance; | ||
case SBD_SYMBOL: | ||
return account.savings_sbd_balance; | ||
default: | ||
GOLOS_CHECK_VALUE(false, "invalid symbol"); | ||
} | ||
case VESTING: | ||
GOLOS_CHECK_VALUE(symbol == VESTS_SYMBOL, "invalid symbol"); | ||
return account.vesting_shares; | ||
case EFFECTIVE_VESTING: | ||
GOLOS_CHECK_VALUE(symbol == VESTS_SYMBOL, "invalid symbol"); | ||
return account.effective_vesting_shares(); | ||
case HAVING_VESTING: | ||
GOLOS_CHECK_VALUE(symbol == VESTS_SYMBOL, "invalid symbol"); | ||
return account.available_vesting_shares(false); | ||
case AVAILABLE_VESTING: | ||
GOLOS_CHECK_VALUE(symbol == VESTS_SYMBOL, "invalid symbol"); | ||
return account.available_vesting_shares(true); | ||
default: FC_ASSERT(false, "invalid balance type"); | ||
} | ||
} | ||
|
||
std::string get_balance_name(balance_type type) { | ||
switch(type) { | ||
case MAIN_BALANCE: return "fund"; | ||
case SAVINGS: return "savings"; | ||
case VESTING: return "vesting shares"; | ||
case EFFECTIVE_VESTING: return "effective vesting shares"; | ||
case HAVING_VESTING: return "having vesting shares"; | ||
case AVAILABLE_VESTING: return "available vesting shares"; | ||
default: FC_ASSERT(false, "invalid balance type"); | ||
} | ||
} | ||
|
||
} } // golos::chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.