Replace most marshaling with codegen

This commit is contained in:
whyrusleeping
2019-08-22 12:53:32 -07:00
parent 53be71fb73
commit 7eb89f90d1
17 changed files with 819 additions and 151 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"github.com/filecoin-project/go-lotus/chain/types"
"github.com/filecoin-project/go-lotus/chain/vm"
"github.com/filecoin-project/go-lotus/lib/bufbstore"
"golang.org/x/xerrors"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-hamt-ipld"
@@ -32,12 +33,12 @@ func (a *ChainAPI) ChainNotify(ctx context.Context) (<-chan *store.HeadChange, e
func (a *ChainAPI) ChainSubmitBlock(ctx context.Context, blk *chain.BlockMsg) error {
if err := a.Chain.AddBlock(blk.Header); err != nil {
return err
return xerrors.Errorf("AddBlock failed: %w", err)
}
b, err := blk.Serialize()
if err != nil {
return err
return xerrors.Errorf("serializing block for pubsub publishing failed: %w", err)
}
// TODO: anything else to do here?