More pond-related fixes
This commit is contained in:
parent
73342e1fcf
commit
cad59b045b
@ -193,7 +193,7 @@ func DumpActorState(code cid.Cid, b []byte) (interface{}, error) {
|
||||
}
|
||||
|
||||
if err := um.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("unmarshaling actor state: %w", err)
|
||||
}
|
||||
|
||||
return rv.Elem().Interface(), nil
|
||||
|
@ -52,7 +52,7 @@ class Address extends React.Component {
|
||||
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 || {}).Cids])
|
||||
|
||||
actorInfo = await this.actorInfo(actor)
|
||||
actorInfo = await this.actorInfo(actor, this.props.addr)
|
||||
if(this.props.miner) {
|
||||
minerInfo = await this.props.client.call('Filecoin.StateMinerPower', [this.props.addr, (this.props.ts || {}).Cids])
|
||||
}
|
||||
@ -70,7 +70,7 @@ class Address extends React.Component {
|
||||
this.props.mountWindow((onClose) => <State addr={this.props.addr} actor={this.state.actor} client={this.props.client} onClose={onClose} mountWindow={this.props.mountWindow}/>)
|
||||
}
|
||||
|
||||
async actorInfo(actor) {
|
||||
async actorInfo(actor, addr) {
|
||||
const c = new CID(actor.Code['/'])
|
||||
const mh = multihash.decode(c.multihash) // TODO: check identity
|
||||
|
||||
@ -82,7 +82,7 @@ class Address extends React.Component {
|
||||
let info = <span>({mh.digest.toString()}{method})</span>
|
||||
switch(mh.digest.toString()) {
|
||||
case 'paych':
|
||||
const actstate = await this.props.client.call('Filecoin.StateReadState', [actor, (this.props.ts || {}).Cids])
|
||||
const actstate = await this.props.client.call('Filecoin.StateReadState', [addr, (this.props.ts || {}).Cids])
|
||||
info = <span>({mh.digest.toString()}{method} to <Address nobalance={true} client={this.props.client} addr={actstate.State.To} mountWindow={this.props.mountWindow}/>)</span>
|
||||
}
|
||||
|
||||
@ -97,10 +97,10 @@ class Address extends React.Component {
|
||||
render() {
|
||||
let add20k = <span/>
|
||||
if(this.props.addN) {
|
||||
add20k = <span> <a href="#" onClick={() => this.props.addN(this.props.addr, 200000)}>[+200k]</a></span>
|
||||
add20k = <span> <a href="#" onClick={() => this.props.addN(this.props.addr, 2e+18)}>[+2]</a></span>
|
||||
if (this.props.add10k) {
|
||||
add20k = <span>{add20k} <a href="#" onClick={() => this.props.addN(this.props.addr, 2000000)}>[+2M]</a></span>
|
||||
add20k = <span>{add20k} <a href="#" onClick={() => this.props.addN(this.props.addr, 20000000)}>[+20M]</a></span>
|
||||
add20k = <span>{add20k} <a href="#" onClick={() => this.props.addN(this.props.addr, 20e+18)}>[+20]</a></span>
|
||||
add20k = <span>{add20k} <a href="#" onClick={() => this.props.addN(this.props.addr, 200e+18)}>[+200]</a></span>
|
||||
add20k = <span>{add20k} <a href="#" onClick={() => this.addColl()}>[<abbr title="min collateral">+C</abbr>]</a></span>
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ class Address extends React.Component {
|
||||
|
||||
let minerInfo = <span/>
|
||||
if(this.state.minerInfo) {
|
||||
minerInfo = <span> Power: {this.state.minerInfo.MinerPower} ({this.state.minerInfo.MinerPower/this.state.minerInfo.TotalPower*100}%)</span>
|
||||
minerInfo = <span> Power: {this.state.minerInfo.MinerPower.QualityAdjPower} ({this.state.minerInfo.MinerPower.QualityAdjPower/this.state.minerInfo.TotalPower.QualityAdjPower*100}%)</span>
|
||||
}
|
||||
|
||||
return <span data-tip data-for={this.props.addr}>{addr}{balance}{actInfo}{nonce}{add20k}{transfer}{minerInfo}</span>
|
||||
|
@ -70,6 +70,8 @@ class Block extends React.Component {
|
||||
<span> <Address client={this.props.conn} short={true} addr="t01" mountWindow={this.props.mountWindow}/></span>
|
||||
<span> <Address client={this.props.conn} short={true} addr="t02" mountWindow={this.props.mountWindow}/></span>
|
||||
<span> <Address client={this.props.conn} short={true} addr="t03" mountWindow={this.props.mountWindow}/></span>
|
||||
<span> <Address client={this.props.conn} short={true} addr="t04" mountWindow={this.props.mountWindow}/></span>
|
||||
<span> <Address client={this.props.conn} short={true} addr="t05" mountWindow={this.props.mountWindow}/></span>
|
||||
<span> <Address client={this.props.conn} short={true} addr="t099" mountWindow={this.props.mountWindow}/></span>
|
||||
</div>
|
||||
<div>----</div>
|
||||
|
@ -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.Cids])
|
||||
const actstate = await this.props.client.call('Filecoin.StateReadState', [this.props.addr, tipset.Cids])
|
||||
|
||||
const c = new CID(this.props.actor.Code['/'])
|
||||
const mh = multihash.decode(c.multihash)
|
||||
@ -80,7 +80,7 @@ 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.Cids])
|
||||
const state = await this.props.client.call('Filecoin.StateReadState', [this.props.actor, tipset.Cids])
|
||||
const state = await this.props.client.call('Filecoin.StateReadState', [this.props.addr, tipset.Cids])
|
||||
|
||||
this.setState({actors, state})
|
||||
}
|
||||
@ -107,7 +107,7 @@ class MarketState extends React.Component {
|
||||
const tipset = await this.props.client.call("Filecoin.ChainHead", []) // TODO: from props
|
||||
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])
|
||||
const state = await this.props.client.call('Filecoin.StateReadState', [this.props.addr, tipset.Cids])
|
||||
this.setState({participants, deals, nextDeal: state.State.NextDealID})
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ 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.Cids])
|
||||
const state = await this.props.client.call('Filecoin.StateReadState', [this.props.addr, 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])
|
||||
|
||||
|
@ -88,8 +88,7 @@ class StorageNode extends React.Component {
|
||||
const peers = await this.state.client.call("Filecoin.NetPeers", [])
|
||||
const actor = await this.state.client.call("Filecoin.ActorAddress", [])
|
||||
|
||||
const stActor = await this.props.fullConn.call('Filecoin.StateGetActor', [actor, null])
|
||||
const actorState = await this.props.fullConn.call('Filecoin.StateReadState', [stActor, null])
|
||||
const actorState = await this.props.fullConn.call('Filecoin.StateReadState', [actor, null])
|
||||
|
||||
this.setState({version: version, peers: peers.length, actor: actor, actorState: actorState})
|
||||
await this.stagedList()
|
||||
@ -98,7 +97,7 @@ class StorageNode extends React.Component {
|
||||
async stagedList() {
|
||||
let stagedList = await this.state.client.call("Filecoin.SectorsList", [])
|
||||
let staged = await stagedList
|
||||
.map(sector => this.state.client.call("Filecoin.SectorsStatus", [sector]))
|
||||
.map(sector => this.state.client.call("Filecoin.SectorsStatus", [sector, false]))
|
||||
.reduce(async (p, n) => [...await p, await n], Promise.resolve([]))
|
||||
|
||||
let statusCounts = staged.reduce((p, n) => p.map((e, i) => e + (i === n.State ? 1 : 0) ), [0, 0, 0, 0, 0])
|
||||
|
@ -3,12 +3,6 @@ import { Buffer } from 'buffer'
|
||||
import { Tagged } from 'borc'
|
||||
|
||||
async function pushMessage(client, from, inmsg) {
|
||||
if(!inmsg.GasLimit) {
|
||||
inmsg.GasLimit = "10000"
|
||||
}
|
||||
if(!inmsg.GasPrice) {
|
||||
inmsg.GasPrice = "0"
|
||||
}
|
||||
if(!inmsg.Params) {
|
||||
inmsg.Params = "oA==" // 0b101_00000: empty cbor map: {}
|
||||
}
|
||||
|
@ -378,22 +378,22 @@ func (a *StateAPI) StateReadState(ctx context.Context, actor address.Address, ts
|
||||
}
|
||||
state, err := a.stateForTs(ctx, ts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("getting state for tipset: %w", err)
|
||||
}
|
||||
|
||||
act, err := state.GetActor(actor)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("getting actor: %w", err)
|
||||
}
|
||||
|
||||
blk, err := state.Store.(*cbor.BasicIpldStore).Blocks.Get(act.Head)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("getting actor head: %w", err)
|
||||
}
|
||||
|
||||
oif, err := vm.DumpActorState(act.Code, blk.RawData())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, xerrors.Errorf("dumping actor state (a:%s): %w", actor, err)
|
||||
}
|
||||
|
||||
return &api.ActorState{
|
||||
|
Loading…
Reference in New Issue
Block a user