diff --git a/lotuspond/front/src/Address.js b/lotuspond/front/src/Address.js index b26461222..96d89a0ad 100644 --- a/lotuspond/front/src/Address.js +++ b/lotuspond/front/src/Address.js @@ -4,9 +4,9 @@ import * as multihash from "multihashes"; import State from "./State"; import methods from "./chain/methods"; -function truncAddr(addr) { - if (addr.length > 21) { - return {addr.substr(0, 18) + '..'} +function truncAddr(addr, len) { + if (addr.length > len) { + return {addr.substr(0, len - 3) + '..'} } return addr } @@ -72,7 +72,7 @@ class Address extends React.Component { if(this.props.add1k) { add1k = this.props.add1k(this.props.addr)}>[+1k] } - let addr = truncAddr(this.props.addr) + let addr = truncAddr(this.props.addr, this.props.short ? 12 : 17) let actInfo = (?) if(this.state.balance >= 0) { @@ -80,17 +80,21 @@ class Address extends React.Component { addr = {addr} } - let balance = : {this.state.balance} + let balance = : {this.state.balance} if(this.props.nobalance) { - balance = + balance = + } + if(this.props.short) { + actInfo = + balance = } - let transfer = + let transfer = if(this.props.transfer) { transfer = {this.props.transfer}FIL } - return {addr}{balance} {actInfo}{add1k}{transfer} + return {addr}{balance}{actInfo}{add1k}{transfer} } } diff --git a/lotuspond/front/src/App.css b/lotuspond/front/src/App.css index 7bb6d42fb..c3649e13e 100644 --- a/lotuspond/front/src/App.css +++ b/lotuspond/front/src/App.css @@ -64,6 +64,7 @@ } .ChainExplorer-at { + min-width: 40em; background: #77ff77; } diff --git a/lotuspond/front/src/Block.js b/lotuspond/front/src/Block.js index 4e239af6b..a7c778320 100644 --- a/lotuspond/front/src/Block.js +++ b/lotuspond/front/src/Block.js @@ -14,8 +14,16 @@ class Block extends React.Component { async loadHeader() { const header = await this.props.conn.call('Filecoin.ChainGetBlock', [this.props.cid]) - const messages = await this.props.conn.call('Filecoin.ChainGetBlockMessages', [this.props.cid]) - console.log(messages) + let messages = await this.props.conn.call('Filecoin.ChainGetBlockMessages', [this.props.cid]) + let receipts = await this.props.conn.call('Filecoin.ChainGetBlockReceipts', [this.props.cid]) + + messages = [ + ...(messages.BlsMessages.map(m => ({...m, type: 'BLS'}))), + ...(messages.SecpkMessages.map(m => ({...(m.Message), type: 'Secpk'}))) + ] + + messages = messages.map((msg, k) => ({...msg, receipt: receipts[k]})) + this.setState({header: header, messages: messages}) } @@ -24,15 +32,12 @@ class Block extends React.Component { if (this.state.header) { let head = this.state.header - - - let messages = [ - ...(this.state.messages.BlsMessages.map(m => ({...m, type: 'BLS'}))), - ...(this.state.messages.SecpkMessages.map(m => ({...(m.Message), type: 'Secpk'}))) - ].map(m => ( + const messages = this.state.messages.map(m => (