Commit 59e0ac3a authored by Jonathan Porta's avatar Jonathan Porta
Browse files

Remove state change

parent e0667b13
......@@ -8,47 +8,25 @@ import { formatter } from '@steemit/steem-js';
export const numberWithCommas = x => x.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
export function vestsToSpf(
total_vesting_shares,
total_vesting_fund_steem,
vesting_shares
) {
console.log('vesting_shares', vesting_shares);
let vests = `${vesting_shares}`;
export function vestsToSpf(state, vesting_shares) {
const { global } = state;
let vests = vesting_shares;
if (typeof vesting_shares === 'string') {
vests = assetFloat(vesting_shares, VEST_TICKER);
}
// console.log('vests', vests);
const total_vests = assetFloat(total_vesting_shares, VEST_TICKER);
// console.log('total_vests', total_vests);
const total_vests = assetFloat(
global.getIn(['props', 'total_vesting_shares']),
VEST_TICKER
);
const total_vest_steem = assetFloat(
total_vesting_fund_steem,
global.getIn(['props', 'total_vesting_fund_steem']),
LIQUID_TICKER
);
console.log(
'return total_vest_steem * (vests / total_vests);',
total_vest_steem,
vests,
total_vests
);
return total_vest_steem * (vests / total_vests);
}
export function vestsToSp(state, vesting_shares) {
console.log('export function vestsToSp(state, vesting_shares) {', state);
const total_vesting_shares = state.global.getIn([
'props',
'total_vesting_shares',
]);
const total_vesting_fund_steem = state.global.getIn([
'props',
'total_vesting_fund_steem',
]);
return vestsToSpf(
total_vesting_shares,
total_vesting_fund_steem,
vesting_shares
).toFixed(3);
return vestsToSpf(state, vesting_shares).toFixed(3);
}
export function spToVestsf(state, steem_power) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment