Skip to content

Commit

Permalink
test-runner: Use stringified Version instead of u64 directly
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Nov 12, 2021
1 parent fa28586 commit 4cb1e15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go/oasis-test-runner/oasis/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ type RuntimeFixture struct { // nolint: maligned
Kind registry.RuntimeKind `json:"kind"`
Entity int `json:"entity"`
Keymanager int `json:"keymanager"`
Version uint64 `json:"version"`
Version string `json:"version"`

Binaries map[node.TEEHardware][]string `json:"binaries"`
GenesisState storage.WriteLog `json:"genesis_state,omitempty"`
Expand Down
11 changes: 8 additions & 3 deletions go/oasis-test-runner/oasis/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type RuntimeCfg struct { // nolint: maligned
Keymanager *Runtime
TEEHardware node.TEEHardware
MrSigner *sgx.MrSigner
Version uint64
Version string

Binaries map[node.TEEHardware][]string
GenesisState storage.WriteLog
Expand Down Expand Up @@ -149,13 +149,18 @@ func (rt *Runtime) ToRuntimeDescriptor() registry.Runtime {

// NewRuntime provisions a new runtime and adds it to the network.
func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error) {
rtVer, err := version.FromString(cfg.Version)
if err != nil {
return nil, fmt.Errorf("oasis/runtime: failed to parse runtime version: %w", err)
}

descriptor := registry.Runtime{
Versioned: cbor.NewVersioned(registry.LatestRuntimeDescriptorVersion),
ID: cfg.ID,
EntityID: cfg.Entity.entity.ID,
Kind: cfg.Kind,
TEEHardware: cfg.TEEHardware,
Version: registry.VersionInfo{Version: version.FromU64(cfg.Version)},
Version: registry.VersionInfo{Version: rtVer},
Executor: cfg.Executor,
TxnScheduler: cfg.TxnScheduler,
Storage: cfg.Storage,
Expand Down Expand Up @@ -226,7 +231,7 @@ func (net *Network) NewRuntime(cfg *RuntimeCfg) (*Runtime, error) {
binaries: cfg.Binaries,
teeHardware: cfg.TEEHardware,
mrSigner: cfg.MrSigner,
version: cfg.Version,
version: rtVer.ToU64(),
pruner: cfg.Pruner,
excludeFromGenesis: cfg.ExcludeFromGenesis,
descriptor: descriptor,
Expand Down

0 comments on commit 4cb1e15

Please sign in to comment.