Skip to content

Commit

Permalink
Merge pull request #175 from iand/lotus-1.5.3
Browse files Browse the repository at this point in the history
Update dependency to lotus 1.5.3
  • Loading branch information
willscott authored Mar 25, 2021
2 parents 2f9a225 + d541516 commit f4ed790
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 121 deletions.
4 changes: 2 additions & 2 deletions cmd/statediff/car.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

bs "github.com/filecoin-project/lotus/lib/blockstore"
bs "github.com/filecoin-project/lotus/blockstore"
"github.com/ipfs/go-cid"
"github.com/ipld/go-car"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -36,7 +36,7 @@ func runCarCmd(c *cli.Context) error {
return err
}

store := bs.NewTemporary()
store := bs.NewMemory()
_, err = car.LoadCar(store, file)
if err != nil {
return err
Expand Down
14 changes: 7 additions & 7 deletions cmd/statediff/vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"os"

bs "github.com/filecoin-project/lotus/lib/blockstore"
bs "github.com/filecoin-project/lotus/blockstore"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/ipld/go-car"
Expand Down Expand Up @@ -58,7 +58,7 @@ func runVectorCmd(c *cli.Context) error {
}
defer gr.Close()

store := bs.NewTemporary()
store := bs.NewMemory()
_, err = car.LoadCar(store, gr)
if err != nil {
return err
Expand All @@ -79,16 +79,16 @@ func runVectorCmd(c *cli.Context) error {
}

func PrintDiff(ctx context.Context, pre, post cid.Cid, store blockstore.Blockstore) (string, error) {
l, err := statediff.Transform(ctx, pre, store, "stateRoot")
l, err := statediff.Transform(ctx, pre, &statediff.LotusBS{store}, "stateRoot")
if err != nil {
l, err = statediff.Transform(ctx, pre, store, "versionedStateRoot")
l, err = statediff.Transform(ctx, pre, &statediff.LotusBS{store}, "versionedStateRoot")
if err != nil {
return "", fmt.Errorf("Could not load left root: %s", err)
}
}
r, err := statediff.Transform(ctx, post, store, "stateRoot")
r, err := statediff.Transform(ctx, post, &statediff.LotusBS{store}, "stateRoot")
if err != nil {
r, err = statediff.Transform(ctx, post, store, "versionedStateRoot")
r, err = statediff.Transform(ctx, post, &statediff.LotusBS{store}, "versionedStateRoot")
if err != nil {
return "", fmt.Errorf("Could not load right root: %s", err)
}
Expand All @@ -97,7 +97,7 @@ func PrintDiff(ctx context.Context, pre, post cid.Cid, store blockstore.Blocksto
s := fmt.Sprintf("--- %s\n+++ %s\n@@ -1,1 +1,1 @@\n", pre, post)
s += fmt.Sprintf("%v\n", statediff.Diff(
ctx,
store,
&statediff.LotusBS{store},
l,
r))
return s, nil
Expand Down
12 changes: 6 additions & 6 deletions cmd/stateql/lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
if err != nil {
return nil, err
}
return statediff.Transform(p.Context, idCid, s, string(statediff.LotusTypeTipset))
return statediff.Transform(p.Context, idCid, &statediff.LotusBS{s}, string(statediff.LotusTypeTipset))
},
},
"Height": &graphql.Field{
Expand All @@ -82,7 +82,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
}
if at == -1 {
ch := source.Head(p.Context)
return statediff.Transform(p.Context, ch, s, string(statediff.LotusTypeTipset))
return statediff.Transform(p.Context, ch, &statediff.LotusBS{s}, string(statediff.LotusTypeTipset))
}
ch, err := source.CidAtHeight(p.Context, int64(at))
if err != nil {
Expand All @@ -91,7 +91,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
if ch == cid.Undef {
return nil, nil
}
return statediff.Transform(p.Context, ch, s, string(statediff.LotusTypeTipset))
return statediff.Transform(p.Context, ch, &statediff.LotusBS{s}, string(statediff.LotusTypeTipset))
},
},
"Message": &graphql.Field{
Expand All @@ -111,7 +111,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
if err != nil {
return nil, err
}
return statediff.Transform(p.Context, idCid, s, string(statediff.LotusTypeMessage))
return statediff.Transform(p.Context, idCid, &statediff.LotusBS{s}, string(statediff.LotusTypeMessage))
},
},
"Heights": &graphql.Field{
Expand Down Expand Up @@ -141,7 +141,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
if ch == cid.Undef {
continue
}
n, err := statediff.Transform(p.Context, ch, s, string(statediff.LotusTypeTipset))
n, err := statediff.Transform(p.Context, ch, &statediff.LotusBS{s}, string(statediff.LotusTypeTipset))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func GetGraphQL(c *cli.Context, source sdlib.Datasource) *http.ServeMux {
if ch == cid.Undef {
continue
}
n, err := statediff.Transform(p.Context, ch, s, string(statediff.LotusTypeTipset))
n, err := statediff.Transform(p.Context, ch, &statediff.LotusBS{s}, string(statediff.LotusTypeTipset))
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/stateql/lib/override.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func AddFields() {
return 0, err
}
mcl := mcid.(cidlink.Link)
if err = statediff.Load(p.Context, mcl.Cid, store, b); err != nil {
if err = statediff.Load(p.Context, mcl.Cid, &statediff.LotusBS{store}, b); err != nil {
return 0, err
}
msg := b.Build()
Expand Down Expand Up @@ -328,7 +328,6 @@ func LotusActors__Head__resolve(p graphql.ResolveParams) (interface{}, error) {
return loader(p.Context, cl, builder)
}
return nil, fmt.Errorf("Invalid link")

}

// For hamts we use the hamt node rather than the expected builder.
Expand Down
2 changes: 1 addition & 1 deletion diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (s *state) nodeLoader(n ipld.Node) interface{} {
return fmt.Sprintf("Unresolved CID %T: %s", n, l.String())
}
builder := proto.NewBuilder()
err := Load(s.ctx, c, s.store, builder)
err := Load(s.ctx, c, &LotusBS{s.store}, builder)
if err != nil {
return fmt.Sprintf("load of %s failed: %v", c, err)
}
Expand Down
6 changes: 1 addition & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ go 1.14

require (
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/evanw/esbuild v0.8.54
github.com/filecoin-project/go-address v0.0.5
github.com/filecoin-project/go-bitfield v0.2.4
Expand All @@ -15,7 +13,7 @@ require (
github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1
github.com/filecoin-project/go-multistore v0.0.3
github.com/filecoin-project/go-state-types v0.1.0
github.com/filecoin-project/lotus v1.5.0
github.com/filecoin-project/lotus v1.5.3
github.com/filecoin-project/specs-actors v0.9.13
github.com/filecoin-project/specs-actors/v2 v2.3.4
github.com/filecoin-project/specs-actors/v3 v3.0.3
Expand All @@ -39,10 +37,8 @@ require (
github.com/multiformats/go-multiaddr-net v0.2.0
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multihash v0.0.14
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a
github.com/urfave/cli/v2 v2.3.0
github.com/valyala/gozstd v1.9.0 // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2
github.com/willscott/carbs v0.0.4
github.com/willscott/go-cmp v0.5.2-0.20200812183318-8affb9542345
Expand Down
Loading

0 comments on commit f4ed790

Please sign in to comment.