pond: Integrate StateReply
This commit is contained in:
parent
9a990dbd8a
commit
18651ecaa3
@ -193,6 +193,8 @@ type MsgWait struct {
|
|||||||
type BlockMessages struct {
|
type BlockMessages struct {
|
||||||
BlsMessages []*types.Message
|
BlsMessages []*types.Message
|
||||||
SecpkMessages []*types.SignedMessage
|
SecpkMessages []*types.SignedMessage
|
||||||
|
|
||||||
|
Cids []cid.Cid
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectorInfo struct {
|
type SectorInfo struct {
|
||||||
|
@ -117,6 +117,23 @@ a:hover {
|
|||||||
|
|
||||||
/* POND */
|
/* POND */
|
||||||
|
|
||||||
|
.Pond-connecting {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
background: #1a1a1a;
|
||||||
|
color: #ffffff;
|
||||||
|
font-family: monospace;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto min-content auto;
|
||||||
|
grid-template-rows: auto min-content auto;
|
||||||
|
grid-template-areas:
|
||||||
|
". . ."
|
||||||
|
". main ."
|
||||||
|
". . ."
|
||||||
|
}
|
||||||
|
|
||||||
.App {
|
.App {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: #1a1a1a;
|
background: #1a1a1a;
|
||||||
|
@ -17,6 +17,8 @@ class Block extends React.Component {
|
|||||||
let messages = await this.props.conn.call('Filecoin.ChainGetBlockMessages', [this.props.cid])
|
let messages = await this.props.conn.call('Filecoin.ChainGetBlockMessages', [this.props.cid])
|
||||||
let receipts = await this.props.conn.call('Filecoin.ChainGetBlockReceipts', [this.props.cid])
|
let receipts = await this.props.conn.call('Filecoin.ChainGetBlockReceipts', [this.props.cid])
|
||||||
|
|
||||||
|
const mcids = messages.Cids
|
||||||
|
|
||||||
messages = [
|
messages = [
|
||||||
...(messages.BlsMessages.map(m => ({...m, type: 'BLS'}))),
|
...(messages.BlsMessages.map(m => ({...m, type: 'BLS'}))),
|
||||||
...(messages.SecpkMessages.map(m => ({...(m.Message), type: 'Secpk'})))
|
...(messages.SecpkMessages.map(m => ({...(m.Message), type: 'Secpk'})))
|
||||||
@ -24,6 +26,17 @@ class Block extends React.Component {
|
|||||||
|
|
||||||
messages = messages.map((msg, k) => ({...msg, receipt: receipts[k]}))
|
messages = messages.map((msg, k) => ({...msg, receipt: receipts[k]}))
|
||||||
|
|
||||||
|
messages = await Promise.all(messages.map(async (msg, i) => {
|
||||||
|
if (msg.receipt.ExitCode !== 0) {
|
||||||
|
let reply = await this.props.conn.call('Filecoin.StateReplay', [{Cids: [this.props.cid], Blocks: [header], Height: header.Height}, mcids[i]])
|
||||||
|
if(!reply.Error) {
|
||||||
|
reply.Error = "reply: no error"
|
||||||
|
}
|
||||||
|
msg.Error = reply.Error
|
||||||
|
}
|
||||||
|
return msg
|
||||||
|
}))
|
||||||
|
|
||||||
this.setState({header: header, messages: messages})
|
this.setState({header: header, messages: messages})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,11 +47,14 @@ class Block extends React.Component {
|
|||||||
|
|
||||||
const messages = this.state.messages.map(m => (
|
const messages = this.state.messages.map(m => (
|
||||||
<div>
|
<div>
|
||||||
<Address client={this.props.conn} addr={m.From} mountWindow={this.props.mountWindow}/><b> => </b>
|
<div>
|
||||||
<Address client={this.props.conn} addr={m.To} mountWindow={this.props.mountWindow} transfer={m.Value} method={m.Method}/>
|
<Address client={this.props.conn} addr={m.From} mountWindow={this.props.mountWindow}/><b> => </b>
|
||||||
<span> N{m.Nonce}</span>
|
<Address client={this.props.conn} addr={m.To} mountWindow={this.props.mountWindow} transfer={m.Value} method={m.Method}/>
|
||||||
<span> {m.receipt.GasUsed}Gas</span>
|
<span> N{m.Nonce}</span>
|
||||||
{m.receipt.ExitCode !== 0 ? <span> <b>EXIT:{m.receipt.ExitCode}</b></span> : <span/>}
|
<span> {m.receipt.GasUsed}Gas</span>
|
||||||
|
{m.receipt.ExitCode !== 0 ? <span> <b>EXIT:{m.receipt.ExitCode}</b></span> : <span/>}
|
||||||
|
</div>
|
||||||
|
{m.receipt.ExitCode !== 0 ? <div> Error: <b>{m.Error}</b></div> : <span/>}
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -35,9 +35,11 @@ class Pond extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
if (this.state.client === undefined) {
|
if (this.state.client === undefined) {
|
||||||
return (
|
return (
|
||||||
|
<div className="Pond-connecting">
|
||||||
<div>
|
<div>
|
||||||
Connecting to RPC
|
<div>Connecting to Pond RPC</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +77,20 @@ func (a *ChainAPI) ChainGetBlockMessages(ctx context.Context, msg cid.Cid) (*api
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cids := make([]cid.Cid, len(bmsgs)+len(smsgs))
|
||||||
|
|
||||||
|
for i, m := range bmsgs {
|
||||||
|
cids[i] = m.Cid()
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, m := range smsgs {
|
||||||
|
cids[i+len(bmsgs)] = m.Cid()
|
||||||
|
}
|
||||||
|
|
||||||
return &api.BlockMessages{
|
return &api.BlockMessages{
|
||||||
BlsMessages: bmsgs,
|
BlsMessages: bmsgs,
|
||||||
SecpkMessages: smsgs,
|
SecpkMessages: smsgs,
|
||||||
|
Cids: cids,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user