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 => (
 => 
+  {m.receipt.GasUsed}Gas + {m.receipt.ExitCode !== 0 ?  EXIT:{m.receipt.ExitCode} : }
)) diff --git a/lotuspond/front/src/BlockLink.js b/lotuspond/front/src/BlockLink.js index bee1aa69c..c9d9561b4 100644 --- a/lotuspond/front/src/BlockLink.js +++ b/lotuspond/front/src/BlockLink.js @@ -1,10 +1,19 @@ import React from 'react'; import Block from "./Block"; +import Address from "./Address"; export class BlockLinks extends React.Component { render() { - return this.props.cids.map(c => ) + return this.props.cids.map((c, k) => { + let block + + if(this.props.blocks) { + block = this.props.blocks[k] + } + + return + }) } } @@ -20,7 +29,12 @@ class BlockLink extends React.Component { } render() { - return {this.props.cid['/'].substr(-8)} + let info = + if(this.props.block) { + info =  (by
) + } + + return {this.props.cid['/'].substr(-8)}{info} } } diff --git a/lotuspond/front/src/ChainExplorer.js b/lotuspond/front/src/ChainExplorer.js index dd15974b2..8347317f8 100644 --- a/lotuspond/front/src/ChainExplorer.js +++ b/lotuspond/front/src/ChainExplorer.js @@ -114,12 +114,15 @@ class ChainExplorer extends React.Component { const ts = this.state.cache[row] let msgc = -1 - if(ts.Cids[0] && this.state.messages[ts.Cids[0]['/']]) { + if(ts.Cids[0] && this.state.messages[ts.Cids[0]['/']]) { // TODO: get from all blks msgc = this.state.messages[ts.Cids[0]['/']].SecpkMessages.length + this.state.messages[ts.Cids[0]['/']].BlsMessages.length } + if(msgc > 0) { + msgc = {msgc} + } info = - Msgs: {msgc} + Msgs: {msgc} } diff --git a/lotuspond/front/src/chain/send.js b/lotuspond/front/src/chain/send.js index 59cdb6951..2a3d0e4f6 100644 --- a/lotuspond/front/src/chain/send.js +++ b/lotuspond/front/src/chain/send.js @@ -4,7 +4,7 @@ import { Tagged } from 'borc' async function pushMessage(client, from, inmsg) { if(!inmsg.GasLimit) { - inmsg.GasLimit = "0" + inmsg.GasLimit = "1000" } if(!inmsg.GasPrice) { inmsg.GasPrice = "0"