Fix staking amount calculation

This commit is contained in:
Marco van Dijk 2022-03-03 20:39:50 +01:00
parent 2681d2c4b2
commit c317eef732

View File

@ -75,7 +75,7 @@ const EventButton = (obj) => {
}) })
// If we only had a bond transaction and nothing else, this is a stake // If we only had a bond transaction and nothing else, this is a stake
if (hasBondTransaction && isOnlyBond){ if (hasBondTransaction && isOnlyBond) {
transactionName = "Stake"; transactionName = "Stake";
thisColour = stakeColour; thisColour = stakeColour;
} }
@ -93,26 +93,33 @@ const EventButton = (obj) => {
<p>called reward worth {transactionAmount.toFixed(2)} LPT</p> <p>called reward worth {transactionAmount.toFixed(2)} LPT</p>
</div> </div>
} }
}else if (transactionName == "Update") { } else if (transactionName == "Update") {
eventSpecificInfo = eventSpecificInfo =
<div className="row"> <div className="row">
<p>changed their reward commission to {transactionAmount.toFixed(2)}% and their fee commission to {transactionAdditionalAmount.toFixed(2)}%</p> <p>changed their reward commission to {transactionAmount.toFixed(2)}% and their fee commission to {transactionAdditionalAmount.toFixed(2)}%</p>
</div> </div>
}else if (transactionName == "Stake") { } else if (transactionName == "Stake") {
if (transactionFrom == "0x0000000000000000000000000000000000000000") {
eventSpecificInfo =
<div className="row">
<p> staked {(transactionAmount / 1000000000000000000).toFixed(2)} LPT to {transactionTo} </p>
</div>
} else {
eventSpecificInfo =
<div className="row">
<p> changed stake from {transactionFrom} to {transactionTo} of {(transactionAmount / 1000000000000000000).toFixed(2)} LPT</p>
</div>
}
} else if (transactionName == "Withdraw") {
eventSpecificInfo = eventSpecificInfo =
<div className="row"> <div className="row">
<p> changed stake from {transactionFrom} to {transactionTo} of {(transactionAmount * 7e-18).toFixed(2)} LPT</p> <p> withdrew {(transactionAmount / 1000000000000000000).toFixed(2)} LPT in round {transactionWhen}</p>
</div>
}else if (transactionName == "Withdraw") {
eventSpecificInfo =
<div className="row">
<p> withdrew {(transactionAmount * 7e-18).toFixed(2)} LPT in round {transactionWhen}</p>
</div> </div>
} else if (transactionName == "Activated") { } else if (transactionName == "Activated") {
if (hasBondTransaction) { if (hasBondTransaction) {
eventSpecificInfo = eventSpecificInfo =
<div className="row"> <div className="row">
<p>{transactionCaller} activated with a self stake of {(transactionAmount * 7e-18).toFixed(2)} LPT and will become active in round {transactionWhen}</p> <p>{transactionCaller} activated with a self stake of {(transactionAmount / 1000000000000000000).toFixed(2)} LPT and will become active in round {transactionWhen}</p>
</div> </div>
} else { } else {
// If there was no bond transaction, display fewer information // If there was no bond transaction, display fewer information