Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Nov 1, 2023
1 parent fede8ab commit 9baf77e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions venus-devtool/compatible/actors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ var replicaCmd = &cli.Command{
{"\"github.com/filecoin-project/lotus/blockstore\"", "blockstore \"github.com/filecoin-project/venus/pkg/util/blockstoreutil\""},
{"golang.org/x/xerrors", "fmt"},
{"xerrors.Errorf", "fmt.Errorf"},
{"codeId", "codeID"},
}

for _, file := range files {
Expand Down
18 changes: 8 additions & 10 deletions venus-shared/actors/builtin_actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ func SetNetworkBundle(networkType int) error {
networkBundle = "mainnet"
}

// The following code cid existed temporarily on the calibnet testnet, as a "buggy" storage miner actor implementation.
// We include it in our builtin bundle, but intentionally omit from metadata.
if NetworkBundle == "calibrationnet" {
AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12)
}

return UseNetworkBundle(networkBundle)
}

Expand All @@ -98,11 +92,9 @@ func UseNetworkBundle(netw string) error {
if NetworkBundle == netw {
return nil
}
if err := loadManifests(netw); err != nil {
return err
}
NetworkBundle = netw
return nil

return loadManifests(netw)
}

func loadManifests(netw string) error {
Expand Down Expand Up @@ -140,6 +132,12 @@ func loadManifests(netw string) error {
RegisterManifest(meta.Version, meta.ManifestCid, meta.Actors)
}

// The following code cid existed temporarily on the calibnet testnet, as a "buggy" storage miner actor implementation.
// We include it in our builtin bundle, but intentionally omit from metadata.
if NetworkBundle == "calibrationnet" {
AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12)
}

return nil
}

Expand Down
4 changes: 2 additions & 2 deletions venus-shared/actors/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func RegisterManifest(av actorstypes.Version, manifestCid cid.Cid, entries map[s
}
}

func AddActorMeta(name string, codeId cid.Cid, av actorstypes.Version) {
func AddActorMeta(name string, codeID cid.Cid, av actorstypes.Version) {
manifestMx.Lock()
defer manifestMx.Unlock()
actorMeta[codeId] = actorEntry{name: name, version: av}
actorMeta[codeID] = actorEntry{name: name, version: av}
}

// GetManifest gets a loaded manifest.
Expand Down

0 comments on commit 9baf77e

Please sign in to comment.