implement looking in the past for messages
This commit is contained in:
committed by
Łukasz Magiera
parent
84985ef96f
commit
14c4a8bee6
@@ -46,20 +46,6 @@ func (a *ChainAPI) ChainGetRandomness(ctx context.Context, pts *types.TipSet, ti
|
||||
return a.Chain.GetRandomness(ctx, pts.Cids(), tickets, int64(lb))
|
||||
}
|
||||
|
||||
func (a *ChainAPI) ChainWaitMsg(ctx context.Context, msg cid.Cid) (*api.MsgWait, error) {
|
||||
// TODO: consider using event system for this, expose confidence
|
||||
|
||||
ts, recpt, err := a.Chain.WaitForMessage(ctx, msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &api.MsgWait{
|
||||
Receipt: *recpt,
|
||||
TipSet: ts,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (a *ChainAPI) ChainGetBlock(ctx context.Context, msg cid.Cid) (*types.BlockHeader, error) {
|
||||
return a.Chain.GetBlock(msg)
|
||||
}
|
||||
|
||||
@@ -193,3 +193,17 @@ 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) {
|
||||
// TODO: consider using event system for this, expose confidence
|
||||
|
||||
ts, recpt, err := a.StateManager.WaitForMessage(ctx, msg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &api.MsgWait{
|
||||
Receipt: *recpt,
|
||||
TipSet: ts,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user