From 2f39499996b3ceb3f604c13c7923d25c628dc236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Fri, 12 Nov 2021 09:52:28 +0100 Subject: [PATCH] test-runner: Read runtime version from fixture --- .changelog/4343.trivial.md | 0 go/oasis-test-runner/oasis/fixture.go | 2 ++ go/oasis-test-runner/oasis/runtime.go | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 .changelog/4343.trivial.md diff --git a/.changelog/4343.trivial.md b/.changelog/4343.trivial.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/go/oasis-test-runner/oasis/fixture.go b/go/oasis-test-runner/oasis/fixture.go index a50909cd0d3..356e06dee35 100644 --- a/go/oasis-test-runner/oasis/fixture.go +++ b/go/oasis-test-runner/oasis/fixture.go @@ -225,6 +225,7 @@ type RuntimeFixture struct { // nolint: maligned Kind registry.RuntimeKind `json:"kind"` Entity int `json:"entity"` Keymanager int `json:"keymanager"` + Version uint64 `json:"version"` Binaries map[node.TEEHardware][]string `json:"binaries"` GenesisState storage.WriteLog `json:"genesis_state,omitempty"` @@ -272,6 +273,7 @@ func (f *RuntimeFixture) Create(netFixture *NetworkFixture, net *Network) (*Runt Keymanager: km, TEEHardware: netFixture.TEE.Hardware, MrSigner: netFixture.TEE.MrSigner, + Version: f.Version, Executor: f.Executor, TxnScheduler: f.TxnScheduler, Storage: f.Storage, diff --git a/go/oasis-test-runner/oasis/runtime.go b/go/oasis-test-runner/oasis/runtime.go index 32aa754edf2..985811d6198 100644 --- a/go/oasis-test-runner/oasis/runtime.go +++ b/go/oasis-test-runner/oasis/runtime.go @@ -14,6 +14,7 @@ import ( "github.com/oasisprotocol/oasis-core/go/common/crypto/hash" "github.com/oasisprotocol/oasis-core/go/common/node" "github.com/oasisprotocol/oasis-core/go/common/sgx" + "github.com/oasisprotocol/oasis-core/go/common/version" "github.com/oasisprotocol/oasis-core/go/oasis-test-runner/env" registry "github.com/oasisprotocol/oasis-core/go/registry/api" scheduler "github.com/oasisprotocol/oasis-core/go/scheduler/api" @@ -36,6 +37,7 @@ type Runtime struct { // nolint: maligned teeHardware node.TEEHardware mrEnclaves []*sgx.MrEnclave mrSigner *sgx.MrSigner + version uint64 pruner RuntimePrunerCfg @@ -52,6 +54,7 @@ type RuntimeCfg struct { // nolint: maligned Keymanager *Runtime TEEHardware node.TEEHardware MrSigner *sgx.MrSigner + Version uint64 Binaries map[node.TEEHardware][]string GenesisState storage.WriteLog @@ -152,6 +155,7 @@ func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error) { EntityID: cfg.Entity.entity.ID, Kind: cfg.Kind, TEEHardware: cfg.TEEHardware, + Version: registry.VersionInfo{Version: version.FromU64(cfg.Version)}, Executor: cfg.Executor, TxnScheduler: cfg.TxnScheduler, Storage: cfg.Storage, @@ -222,6 +226,7 @@ func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error) { binaries: cfg.Binaries, teeHardware: cfg.TEEHardware, mrSigner: cfg.MrSigner, + version: cfg.Version, pruner: cfg.Pruner, excludeFromGenesis: cfg.ExcludeFromGenesis, descriptor: descriptor,