diff --git a/lib/jsonrpc/handler.go b/lib/jsonrpc/handler.go index 4268e8af6..5d4380046 100644 --- a/lib/jsonrpc/handler.go +++ b/lib/jsonrpc/handler.go @@ -192,7 +192,7 @@ func (h handlers) handle(ctx context.Context, req request, w func(func(io.Writer for i := 0; i < handler.nParams; i++ { rp := reflect.New(handler.paramReceivers[i]) if err := json.NewDecoder(bytes.NewReader(req.Params[i].data)).Decode(rp.Interface()); err != nil { - rpcError(w, &req, rpcParseError, xerrors.Errorf("unmarshaling params for '%s': %w", handler.handlerFunc, err)) + rpcError(w, &req, rpcParseError, xerrors.Errorf("unmarshaling params for '%s' (param: %T): %w", req.Method, rp.Interface(), err)) stats.Record(ctx, metrics.RPCRequestError.M(1)) return } diff --git a/lotuspond/front/src/Address.js b/lotuspond/front/src/Address.js index 1ac98d7f2..9167abfb1 100644 --- a/lotuspond/front/src/Address.js +++ b/lotuspond/front/src/Address.js @@ -50,11 +50,11 @@ class Address extends React.Component { try { balance = await this.props.client.call('Filecoin.WalletBalance', [this.props.addr]) - actor = await this.props.client.call('Filecoin.StateGetActor', [this.props.addr, this.props.ts || null]) + actor = await this.props.client.call('Filecoin.StateGetActor', [this.props.addr, (this.props.ts || {}).Cids]) actorInfo = await this.actorInfo(actor) if(this.props.miner) { - minerInfo = await this.props.client.call('Filecoin.StateMinerPower', [this.props.addr, this.props.ts || null]) + minerInfo = await this.props.client.call('Filecoin.StateMinerPower', [this.props.addr, (this.props.ts || {}).Cids]) } if(this.props.nonce) { nonce = await this.props.client.call('Filecoin.MpoolGetNonce', [this.props.addr]) @@ -82,7 +82,7 @@ class Address extends React.Component { let info = ({mh.digest.toString()}{method}) switch(mh.digest.toString()) { case 'paych': - const actstate = await this.props.client.call('Filecoin.StateReadState', [actor, this.props.ts || null]) + const actstate = await this.props.client.call('Filecoin.StateReadState', [actor, (this.props.ts || {}).Cids]) info = ({mh.digest.toString()}{method} to
) } diff --git a/lotuspond/front/src/BlockLink.js b/lotuspond/front/src/BlockLink.js index bfdbd5ea9..1d524999f 100644 --- a/lotuspond/front/src/BlockLink.js +++ b/lotuspond/front/src/BlockLink.js @@ -12,7 +12,7 @@ export class BlockLinks extends React.Component { block = this.props.blocks[k] } - return + return }) } } diff --git a/lotuspond/front/src/FullNode.js b/lotuspond/front/src/FullNode.js index eb530dee3..f9ca779a5 100644 --- a/lotuspond/front/src/FullNode.js +++ b/lotuspond/front/src/FullNode.js @@ -45,7 +45,7 @@ class FullNode extends React.Component { return this.props.client.call('Filecoin.PaychVoucherList', [paych]) })) - let mpoolPending = (await this.props.client.call('Filecoin.MpoolPending', [tipset])).length + let mpoolPending = (await this.props.client.call('Filecoin.MpoolPending', [tipset.Cids])).length this.setState(() => ({ id: id, @@ -64,13 +64,13 @@ class FullNode extends React.Component { } async newSecpAddr() { - const t = "secp256k1" + const t = 1 await this.props.client.call("Filecoin.WalletNew", [t]) this.loadInfo() } async newBLSAddr() { - const t = "bls" + const t = 2 await this.props.client.call("Filecoin.WalletNew", [t]) this.loadInfo() } diff --git a/lotuspond/front/src/State.js b/lotuspond/front/src/State.js index d5b81ff83..ade42f2e5 100644 --- a/lotuspond/front/src/State.js +++ b/lotuspond/front/src/State.js @@ -22,7 +22,7 @@ class State extends React.Component { async componentDidMount() { const tipset = this.props.tipset || await this.props.client.call("Filecoin.ChainHead", []) - const actstate = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset]) + const actstate = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset.Cids]) const c = new CID(this.props.actor.Code['/']) const mh = multihash.decode(c.multihash) @@ -37,7 +37,7 @@ class State extends React.Component { const Stelem = this.byCode[this.state.code] state = } else { - state =
{Object.keys(this.state.State).map(k =>
{k}: {JSON.stringify(this.state.State[k])}
)}
+ state =
{Object.keys(this.state.State || {}).map(k =>
{k}: {JSON.stringify(this.state.State[k])}
)}
} const content =
@@ -60,7 +60,7 @@ class InitState extends React.Component { async componentDidMount() { const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props - const actors = await this.props.client.call("Filecoin.StateListActors", [tipset]) + const actors = await this.props.client.call("Filecoin.StateListActors", [tipset.Cids]) this.setState({actors: actors}) } @@ -79,8 +79,8 @@ class PowerState extends React.Component { async componentDidMount() { const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props - const actors = await this.props.client.call("Filecoin.StateListMiners", [tipset]) - const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset]) + const actors = await this.props.client.call("Filecoin.StateListMiners", [tipset.Cids]) + const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset.Cids]) this.setState({actors, state}) } @@ -105,9 +105,9 @@ class MarketState extends React.Component { async componentDidMount() { const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props - const participants = await this.props.client.call("Filecoin.StateMarketParticipants", [tipset]) - const deals = await this.props.client.call("Filecoin.StateMarketDeals", [tipset]) - const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset]) + const participants = await this.props.client.call("Filecoin.StateMarketParticipants", [tipset.Cids]) + const deals = await this.props.client.call("Filecoin.StateMarketDeals", [tipset.Cids]) + const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset.Cids]) this.setState({participants, deals, nextDeal: state.State.NextDealID}) } @@ -128,15 +128,15 @@ class MarketState extends React.Component {
---
Deals ({this.state.nextDeal} Total):
- + {Object.keys(this.state.deals).map(d => - - - - - - + + + + + + )}
idActiveClientProviderSizePriceDuration
idStartedClientProviderSizePriceDuration
{d}{this.state.deals[d].ActivationEpoch || "No"}
{this.state.deals[d].Deal.Proposal.PieceSize}B{this.state.deals[d].Deal.Proposal.StoragePricePerEpoch*this.state.deals[d].Deal.Proposal.Duration}{this.state.deals[d].Deal.Proposal.Duration}{this.state.deals[d].State.SectorStartEpoch || "No"}
{this.state.deals[d].Proposal.PieceSize}B{this.state.deals[d].Proposal.StoragePricePerEpoch*(this.state.deals[d].Proposal.EndEpoch-this.state.deals[d].Proposal.StartEpoch)}{this.state.deals[d].Proposal.EndEpoch-this.state.deals[d].Proposal.StartEpoch}
@@ -153,17 +153,17 @@ class MinerState extends React.Component { async componentDidMount() { const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props - const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset]) - const sectorSize = await this.props.client.call("Filecoin.StateMinerSectorSize", [this.props.addr, tipset]) - const worker = await this.props.client.call("Filecoin.StateMinerWorker", [this.props.addr, tipset]) + const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset.Cids]) + const sectorSize = await this.props.client.call("Filecoin.StateMinerSectorSize", [this.props.addr, tipset.Cids]) + const worker = await this.props.client.call("Filecoin.StateMinerWorker", [this.props.addr, tipset.Cids]) - const tpow = await this.props.client.call("Filecoin.StateMinerPower", [this.props.addr, tipset]) + const tpow = await this.props.client.call("Filecoin.StateMinerPower", [this.props.addr, tipset.Cids]) const networkPower = tpow.TotalPower let sectors = {} - const sset = await this.props.client.call("Filecoin.StateMinerSectors", [this.props.addr, tipset]) || [] - const pset = await this.props.client.call("Filecoin.StateMinerProvingSet", [this.props.addr, tipset]) || [] + const sset = await this.props.client.call("Filecoin.StateMinerSectors", [this.props.addr, tipset.Cids]) || [] + const pset = await this.props.client.call("Filecoin.StateMinerProvingSet", [this.props.addr, tipset.Cids]) || [] sset.forEach(s => sectors[s.SectorID] = {...s, sectorSet: true}) pset.forEach(s => sectors[s.SectorID] = {...(sectors[s.SectorID] || s), provingSet: true}) @@ -181,7 +181,7 @@ class MinerState extends React.Component { return
Worker:
Sector Size: {this.state.sectorSize/1024} KiB
-
Power: {state.Power} ({state.Power/this.state.networkPower*100}%)
+
Power: todoPower ({1/this.state.networkPower*100}%)
Election Period Start: {state.ElectionPeriodStart}
Slashed: {state.SlashedAt === 0 ? "NO" : state.SlashedAt}