Skip to content

Commit

Permalink
test-runner: Read runtime version from fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Nov 12, 2021
1 parent a3491a8 commit 2f39499
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Empty file added .changelog/4343.trivial.md
Empty file.
2 changes: 2 additions & 0 deletions go/oasis-test-runner/oasis/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions go/oasis-test-runner/oasis/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -36,6 +37,7 @@ type Runtime struct { // nolint: maligned
teeHardware node.TEEHardware
mrEnclaves []*sgx.MrEnclave
mrSigner *sgx.MrSigner
version uint64

pruner RuntimePrunerCfg

Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2f39499

Please sign in to comment.