aboutsummaryrefslogtreecommitdiffstats
path: root/vm/proxyapp
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-07-23 14:13:28 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-07-23 13:30:23 +0000
commit53c2e8ad91fd5f64989a4e6a923926990130b5cd (patch)
treea4ba74c7dcaebf772436725f3ccf2e4e65baa659 /vm/proxyapp
parente50e8da5c493b37bff754d816c11218eba03d715 (diff)
vmimpl: refactor VM type registration
Pass Type struct directly during registration. This allows to add additional optional parameters to VM types without changing all VM implementations. We we will need to add SupportsSnapshots flag and one flag to resolve #5028. With this change it will be possible to add "SupportsSnapshots: true" to just one VM type implemenetation.
Diffstat (limited to 'vm/proxyapp')
-rw-r--r--vm/proxyapp/init.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/vm/proxyapp/init.go b/vm/proxyapp/init.go
index 467187f46..0500298e6 100644
--- a/vm/proxyapp/init.go
+++ b/vm/proxyapp/init.go
@@ -27,12 +27,11 @@ func makeDefaultParams() *proxyAppParams {
}
func init() {
- vmimpl.Register(
- "proxyapp",
- func(env *vmimpl.Env) (vmimpl.Pool, error) {
+ vmimpl.Register("proxyapp", vmimpl.Type{
+ Ctor: func(env *vmimpl.Env) (vmimpl.Pool, error) {
return ctor(makeDefaultParams(), env)
},
- false)
+ })
}
// Package configuration VARs are mostly needed for tests.