Skip to content

Commit

Permalink
Add datacap actor to registry.go
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Oct 12, 2022
1 parent 9b96ad5 commit 163c917
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions chain/actors/builtin/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
verifreg8 "github.com/filecoin-project/go-state-types/builtin/v8/verifreg"
account9 "github.com/filecoin-project/go-state-types/builtin/v9/account"
cron9 "github.com/filecoin-project/go-state-types/builtin/v9/cron"
datacap9 "github.com/filecoin-project/go-state-types/builtin/v9/datacap"
_init9 "github.com/filecoin-project/go-state-types/builtin/v9/init"
market9 "github.com/filecoin-project/go-state-types/builtin/v9/market"
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
Expand Down Expand Up @@ -150,6 +151,7 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
methods: verifreg8.Methods,
state: new(verifreg8.State),
})

}
}

Expand Down Expand Up @@ -222,6 +224,12 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
methods: verifreg9.Methods,
state: new(verifreg9.State),
})
case actors.DatacapKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: datacap9.Methods,
state: new(datacap9.State),
})
}
}

Expand Down
9 changes: 9 additions & 0 deletions chain/actors/builtin/registry.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
system{{.}} "github.com/filecoin-project/go-state-types/builtin/v{{.}}/system"
verifreg{{.}} "github.com/filecoin-project/go-state-types/builtin/v{{.}}/verifreg"
{{end}}
{{if (ge . 9)}}
datacap{{.}} "github.com/filecoin-project/go-state-types/builtin/v{{.}}/datacap"
{{end}}
{{end}}
"github.com/filecoin-project/go-state-types/cbor"
rtt "github.com/filecoin-project/go-state-types/rt"
Expand Down Expand Up @@ -142,6 +145,12 @@ func MakeRegistry(av actorstypes.Version) []RegistryEntry {
methods: verifreg{{.}}.Methods,
state: new(verifreg{{.}}.State),
})
{{if (ge . 9)}}case actors.DatacapKey:
registry = append(registry, RegistryEntry{
code: codeID,
methods: datacap{{.}}.Methods,
state: new(datacap{{.}}.State),
}){{end}}
}
}
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
github.com/filecoin-project/go-legs v0.4.4
github.com/filecoin-project/go-padreader v0.0.1
github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.9.0-rc1
github.com/filecoin-project/go-state-types v0.9.0-rc2.0.20221012181308-18973e7a46fc
github.com/filecoin-project/go-statemachine v1.0.2
github.com/filecoin-project/go-statestore v0.2.0
github.com/filecoin-project/go-storedcounter v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.9.0-rc1 h1:cK6OzKP11aIFt0fbor/lqvrzEBegbMGHnSr9LJN/r4g=
github.com/filecoin-project/go-state-types v0.9.0-rc1/go.mod h1:+HCZifUV+e8TlQkgll22Ucuiq8OrVJkK+4Kh4u75iiw=
github.com/filecoin-project/go-state-types v0.9.0-rc2.0.20221012181308-18973e7a46fc h1:IpOrqNeYQMqBgLIHi1JUKILXkOIfg+hKJoO5P0HfP4c=
github.com/filecoin-project/go-state-types v0.9.0-rc2.0.20221012181308-18973e7a46fc/go.mod h1:+HCZifUV+e8TlQkgll22Ucuiq8OrVJkK+4Kh4u75iiw=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
Expand Down

0 comments on commit 163c917

Please sign in to comment.