Merge remote-tracking branch 'origin/testnet/3' into feat/new-workers

This commit is contained in:
Łukasz Magiera
2020-03-25 01:02:23 +01:00
11 changed files with 116 additions and 14 deletions
+18 -2
View File
@@ -281,7 +281,7 @@ func (a *StateAPI) MinerCreateBlock(ctx context.Context, addr address.Address, p
return &out, nil
}
func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid) (*api.MsgWait, error) {
func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
// TODO: consider using event system for this, expose confidence
ts, recpt, err := a.StateManager.WaitForMessage(ctx, msg)
@@ -289,12 +289,28 @@ func (a *StateAPI) StateWaitMsg(ctx context.Context, msg cid.Cid) (*api.MsgWait,
return nil, err
}
return &api.MsgWait{
return &api.MsgLookup{
Receipt: *recpt,
TipSet: ts,
}, nil
}
func (a *StateAPI) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) {
ts, recpt, err := a.StateManager.SearchForMessage(ctx, msg)
if err != nil {
return nil, err
}
if ts != nil {
return &api.MsgLookup{
Receipt: *recpt,
TipSet: ts,
}, nil
} else {
return nil, nil
}
}
func (a *StateAPI) StateGetReceipt(ctx context.Context, msg cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) {
ts, err := a.Chain.GetTipSetFromKey(tsk)
if err != nil {