Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
82 lines
2 KiB
Go
82 lines
2 KiB
Go
//go:build !relayer
|
|
|
|
package app_test
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"gopkg.in/yaml.v3"
|
|
|
|
"github.com/ignite/cli/v29/ignite/config/chain"
|
|
"github.com/ignite/cli/v29/ignite/config/chain/base"
|
|
v1 "github.com/ignite/cli/v29/ignite/config/chain/v1"
|
|
"github.com/ignite/cli/v29/ignite/pkg/xyaml"
|
|
envtest "github.com/ignite/cli/v29/integration"
|
|
)
|
|
|
|
const newProtoPath = "myProto"
|
|
|
|
var (
|
|
bobName = "bob"
|
|
cfg = v1.Config{
|
|
Config: base.Config{
|
|
Version: 1,
|
|
Build: base.Build{
|
|
Proto: base.Proto{
|
|
Path: newProtoPath,
|
|
},
|
|
},
|
|
Accounts: []base.Account{
|
|
{
|
|
Name: "alice",
|
|
Coins: []string{"100000000000token", "10000000000000000000stake"},
|
|
Mnemonic: "slide moment original seven milk crawl help text kick fluid boring awkward doll wonder sure fragile plate grid hard next casual expire okay body",
|
|
},
|
|
{
|
|
Name: bobName,
|
|
Coins: []string{"100000000000token", "10000000000000000000stake"},
|
|
Mnemonic: "trap possible liquid elite embody host segment fantasy swim cable digital eager tiny broom burden diary earn hen grow engine pigeon fringe claim program",
|
|
},
|
|
},
|
|
Faucet: base.Faucet{
|
|
Name: &bobName,
|
|
Coins: []string{"500token", "100000000stake"},
|
|
Host: ":4501",
|
|
},
|
|
Genesis: xyaml.Map{"chain_id": "mars-1"},
|
|
},
|
|
Validators: []v1.Validator{
|
|
{
|
|
Name: "alice",
|
|
Bonded: "100000000stake",
|
|
},
|
|
},
|
|
}
|
|
)
|
|
|
|
func TestChangeProtoPath(t *testing.T) {
|
|
var (
|
|
env = envtest.New(t)
|
|
app = env.ScaffoldApp("github.com/test/protopath", "--proto-dir", newProtoPath)
|
|
appPath = app.SourcePath()
|
|
cfgPath = filepath.Join(appPath, chain.ConfigFilenames[0])
|
|
)
|
|
|
|
// set the custom config path.
|
|
file, err := os.Create(cfgPath)
|
|
require.NoError(t, err)
|
|
require.NoError(t, yaml.NewEncoder(file).Encode(cfg))
|
|
require.NoError(t, file.Close())
|
|
app.SetConfigPath(cfgPath)
|
|
|
|
app.Scaffold(
|
|
"create a list with a custom proto path from config",
|
|
false,
|
|
"list", "listUser", "email",
|
|
)
|
|
|
|
app.EnsureSteady()
|
|
}
|