-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathchains_commands_integration_test.go
More file actions
61 lines (51 loc) · 1.64 KB
/
chains_commands_integration_test.go
File metadata and controls
61 lines (51 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//go:build integration
package cmd_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/smartcontractkit/chainlink/v2/core/cmd"
"github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/cosmostest"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils/solanatest"
"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
)
func TestShell_IndexCosmosChains(t *testing.T) {
t.Parallel()
chainID := cosmostest.RandomChainID()
chain := chainlink.RawConfig{
"ChainID": chainID,
"Nodes": []map[string]any{{
"Name": "primary",
"TendermintURL": "http://tender.mint",
}},
}
app := cosmosStartNewApplication(t, chain)
client, r := app.NewShellAndRenderer()
require.NoError(t, cmd.NewChainClient(client, "cosmos").IndexChains(cltest.EmptyCLIContext()))
chains := *r.Renders[0].(*cmd.ChainPresenters)
require.Len(t, chains, 1)
c := chains[0]
assert.Equal(t, chainID, c.ID)
assertTableRenders(t, r)
}
func TestShell_IndexSolanaChains(t *testing.T) {
t.Parallel()
id := solanatest.RandomChainID()
chain := chainlink.RawConfig{
"ChainID": id,
"Enabled": true,
"Nodes": []map[string]any{{
"Name": "primary",
"URL": "http://solana.example",
}},
}
app := solanaStartNewApplication(t, chain)
client, r := app.NewShellAndRenderer()
require.NoError(t, cmd.NewChainClient(client, "solana").IndexChains(cltest.EmptyCLIContext()))
chains := *r.Renders[0].(*cmd.ChainPresenters)
require.Len(t, chains, 1)
c := chains[0]
assert.Equal(t, id, c.ID)
assertTableRenders(t, r)
}