Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): fix dot unit tests #2561

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/gossamer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/ChainSafe/gossamer/internal/log"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/runtime/life"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
"github.com/ChainSafe/gossamer/lib/utils"
"github.com/urfave/cli"
Expand Down Expand Up @@ -625,8 +624,6 @@ func setDotCoreConfig(ctx *cli.Context, tomlCfg ctoml.CoreConfig, cfg *dot.CoreC
switch tomlCfg.WasmInterpreter {
case wasmer.Name:
cfg.WasmInterpreter = wasmer.Name
case life.Name:
cfg.WasmInterpreter = life.Name
case "":
cfg.WasmInterpreter = gssmr.DefaultWasmInterpreter
default:
Expand Down
6 changes: 3 additions & 3 deletions dot/build_spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ func TestBuildFromDB(t *testing.T) {
}{
{name: "normal conditions", path: cfg.Global.BasePath,
want: &BuildSpec{genesis: &genesis.Genesis{
Name: "Gossamer",
ID: "gssmr",
Name: "Gossamer Testnet",
ID: "gssmr_test",
Bootnodes: []string{},
ProtocolID: "/gossamer/gssmr/0",
ProtocolID: "gssmr_test",
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
Genesis: genesis.Fields{
Raw: map[string]map[string]string{},
Runtime: map[string]map[string]interface{}{},
Expand Down
18 changes: 0 additions & 18 deletions dot/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/runtime/life"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
"github.com/ChainSafe/gossamer/lib/utils"
)
Expand Down Expand Up @@ -151,23 +150,6 @@ func createRuntime(cfg *Config, ns runtime.NodeStorage, st *state.Service,
if err != nil {
return nil, fmt.Errorf("failed to create runtime executor: %s", err)
}
case life.Name:
rtCfg := &life.Config{
Resolver: new(life.Resolver),
}
rtCfg.Storage = ts
rtCfg.Keystore = ks
rtCfg.LogLvl = cfg.Log.RuntimeLvl
rtCfg.NodeStorage = ns
rtCfg.Network = net
rtCfg.Role = cfg.Core.Roles
rtCfg.CodeHash = codeHash

// create runtime executor
rt, err = life.NewInstance(code, rtCfg)
if err != nil {
return nil, fmt.Errorf("failed to create runtime executor: %s", err)
}
default:
return nil, fmt.Errorf("%w: %s", ErrWasmInterpreterName, cfg.Core.WasmInterpreter)
}
Expand Down
13 changes: 0 additions & 13 deletions dot/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/runtime/life"
rtstorage "github.com/ChainSafe/gossamer/lib/runtime/storage"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -467,9 +466,6 @@ func Test_createRuntime(t *testing.T) {
t.Parallel()
cfg := NewTestConfig(t)

cfgLife := NewTestConfig(t)
cfgLife.Core.WasmInterpreter = life.Name

type args struct {
cfg *Config
ns runtime.NodeStorage
Expand All @@ -489,15 +485,6 @@ func Test_createRuntime(t *testing.T) {
expectedType: &wasmer.Instance{},
err: nil,
},
{
name: "wasmer life",
args: args{
cfg: cfgLife,
ns: runtime.NodeStorage{},
},
expectedType: &life.Instance{},
err: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions dot/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import (
func newTestGenesisFile(t *testing.T, cfg *Config) (filename string) {
t.Helper()

fp := utils.GetGssmrGenesisPathTest(t)

fp := utils.GetGssmrGenesisRawPathTest(t)
gssmrGen, err := genesis.NewGenesisFromJSON(fp, 0)
require.NoError(t, err)

Expand Down Expand Up @@ -64,7 +63,7 @@ func TestCreateJSONRawFile(t *testing.T) {
bs: &BuildSpec{genesis: NewTestGenesis(t)},
fp: filepath.Join(t.TempDir(), "/test.json"),
},
expectedHash: "23356cdb5d3537d39b735726707216c9e329c7b8a2c8a41b25da0f5f936b3caa",
expectedHash: "6453fb6118dab594944a7ed68111fdccc3a68253c9d71ac05f27aa2359507c85",
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
},
}
for _, tt := range tests {
Expand Down
176 changes: 0 additions & 176 deletions lib/runtime/life/exports.go

This file was deleted.

Loading