Scaffolding for API versioning

This commit is contained in:
Łukasz Magiera
2021-03-23 16:40:22 +01:00
parent c41777dcd2
commit 571114bc44
5 changed files with 737 additions and 10 deletions
+32
View File
@@ -0,0 +1,32 @@
package v0api
import (
"github.com/filecoin-project/lotus/api/v1api"
)
type WrapperV1 struct {
v1api.FullNode
}
/* example:
- dropped StateGetReceipt
- tsk param for StateSearchMsg
func (w *WrapperV1) StateSearchMsg(ctx context.Context, c cid.Cid) (*api.MsgLookup, error) {
return w.FullNode.StateSearchMsg(ctx, c, types.EmptyTSK)
}
func (w *WrapperV1) StateGetReceipt(ctx context.Context, cid cid.Cid, key types.TipSetKey) (*types.MessageReceipt, error) {
m, err := w.FullNode.StateSearchMsg(ctx, cid, key)
if err != nil {
return nil, err
}
if m == nil {
return nil, nil
}
return &m.Receipt, nil
}*/
var _ FullNode = &WrapperV1{}