Compiling with the new weight func
This commit is contained in:
+6
-2
@@ -3,6 +3,7 @@ package hello
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/filecoin-project/go-lotus/chain/types"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
@@ -26,7 +27,7 @@ func init() {
|
||||
|
||||
type Message struct {
|
||||
HeaviestTipSet []cid.Cid
|
||||
HeaviestTipSetWeight uint64
|
||||
HeaviestTipSetWeight types.BigInt
|
||||
GenesisHash cid.Cid
|
||||
}
|
||||
|
||||
@@ -83,7 +84,10 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
|
||||
defer s.Close()
|
||||
|
||||
hts := hs.cs.GetHeaviestTipSet()
|
||||
weight := hs.cs.Weight(hts)
|
||||
weight, err := hs.cs.Weight(ctx, hts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
gen, err := hs.cs.GetGenesis()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -160,3 +160,7 @@ func (a *ChainAPI) ChainGetGenesis(ctx context.Context) (*types.TipSet, error) {
|
||||
|
||||
return types.NewTipSet([]*types.BlockHeader{genb})
|
||||
}
|
||||
|
||||
func (a *ChainAPI) ChainTipSetWeight(ctx context.Context, ts *types.TipSet) (types.BigInt, error) {
|
||||
return a.Chain.Weight(ctx, ts)
|
||||
}
|
||||
|
||||
@@ -226,7 +226,3 @@ func (a *StateAPI) StateListMiners(ctx context.Context, ts *types.TipSet) ([]add
|
||||
func (a *StateAPI) StateListActors(ctx context.Context, ts *types.TipSet) ([]address.Address, error) {
|
||||
return a.StateManager.ListAllActors(ctx, ts)
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateTipSetWeight(ctx context.Context, ts *types.TipSet) (types.BigInt, error) {
|
||||
return a.Chain.Weight(ctx, ts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user