This commit is contained in:
Łukasz Magiera 2019-10-01 00:37:01 +02:00
parent f19c712ebf
commit b63aa91660
2 changed files with 7 additions and 1 deletions

View File

@ -86,5 +86,5 @@ func (tsc *tipSetCache) best() *types.TipSet {
}
func normalModulo(n, m int) int {
return (n%m + m) % m
return ((n % m) + m) % m
}

View File

@ -84,6 +84,11 @@ class Address extends React.Component {
return info
}
addColl = async () => {
const coll = await this.props.client.call('Filecoin.StatePledgeCollateral', [null])
this.props.addN(this.props.addr, coll)
}
render() {
let add20k = <span/>
if(this.props.addN) {
@ -91,6 +96,7 @@ class Address extends React.Component {
if (this.props.add10k) {
add20k = <span>{add20k}&nbsp;<a href="#" onClick={() => this.props.addN(this.props.addr, 2000000)}>[+2M]</a></span>
add20k = <span>{add20k}&nbsp;<a href="#" onClick={() => this.props.addN(this.props.addr, 20000000)}>[+20M]</a></span>
add20k = <span>{add20k}&nbsp;<a href="#" onClick={() => this.addColl()}>[<abbr title="min collateral">+C</abbr>]</a></span>
}
}
let addr = truncAddr(this.props.addr, this.props.short ? 12 : 17)