-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add app test * chore: not ignore assets * Update pkg/app.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update pkg/app_test.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: add cmd test * chore: add readme badge --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
87241cf
commit ce2df06
Showing
14 changed files
with
426 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
main | ||
config*.toml | ||
!assets/config*.toml | ||
cosmos-validators-exporter | ||
.idea/ | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
listen-address = "invalid" | ||
|
||
[[chains]] | ||
name = "sentinel" | ||
lcd-endpoint = "https://api.sentinel.quokkastake.io" | ||
coingecko-currency = "sentinel" | ||
base-denom = "udvpn" | ||
bech-wallet-prefix = "sent" | ||
validators = [ | ||
{ address = "sentvaloper1rw9wtyhsus7jvx55v3qv5nzun054ma6kz4237k" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[log] | ||
level = "debug" | ||
|
||
[[chains]] | ||
name = "cosmos" | ||
lcd-endpoint = "https://api.cosmos.quokkastake.io" | ||
bech-wallet-prefix = "cosmos" | ||
validators = [ | ||
{ address = "cosmosvaloper1xqz9pemz5e5zycaa89kys5aw6m8rhgsvw4328e", consensus-address = "cosmosvalcons1rt4g447zhv6jcqwdl447y88guwm0eevnrelgzc" } | ||
] | ||
base-denom = "uatom" | ||
is-provider = true | ||
denoms = [ | ||
{ denom = "uatom", display-denom = "atom", coingecko-currency = "cosmos" }, | ||
{ denom = "ibc/0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5", display-denom = "ntrn", coingecko-currency = "neutron" }, | ||
{ denom = "ibc/6B8A3F5C2AD51CD6171FA41A7E8C35AD594AB69226438DB94450436EA57B3A89", display-denom = "strd", coingecko-currency = "stride" }, | ||
{ denom = "ibc/054892D6BB43AF8B93AAC28AA5FD7019D2C59A15DAFD6F45C1FA2BF9BDA22454", display-denom = "stosmo", coingecko-currency = "osmosis" }, | ||
{ denom = "ibc/5CAE744C89BC70AE7B38019A1EDF83199B7E10F00F160E7F4F12BCA7A32A7EE5", display-denom = "stluna", coingecko-currency = "terra-luna-2" }, | ||
{ denom = "ibc/715BD634CF4D914C3EE93B0F8A9D2514B743F6FE36BC80263D1BC5EE4B3C5D40", display-denom = "ststars", coingecko-currency = "stargaze" }, | ||
{ denom = "ibc/88DCAA43A9CD099E1F9BBB80B9A90F64782EBA115A84B2CD8398757ADA4F4B40", display-denom = "stjuno", coingecko-currency = "juno-network" }, | ||
{ denom = "ibc/A4D99E716D91A579AC3A9684AAB7B5CB0A0861DD3DD942901D970EDB6787860E", display-denom = "stsomm", coingecko-currency = "sommelier" }, | ||
{ denom = "ibc/B011C1A0AD5E717F674BA59FD8E05B2F946E4FD41C9CB3311C95F7ED4B815620", display-denom = "stinj", denom-coefficient = 1000000000000000000, coingecko-currency = "injective-protocol" }, | ||
{ denom = "ibc/B05539B66B72E2739B986B86391E5D08F12B8D5D2C2A7F8F8CF9ADF674DFA231", display-denom = "statom", coingecko-currency = "cosmos" }, | ||
{ denom = "ibc/B38AAA0F7A3EC4D7C8E12DFA33FF93205FE7A42738A4B0590E2FF15BC60A612B", display-denom = "stevmos", denom-coefficient = 1000000000000000000, coingecko-currency = "evmos" }, | ||
{ denom = "ibc/D41ECC8FEF1B7E9C4BCC58B1362588420853A9D0B898EDD513D9B79AFFA195C8", display-denom = "stumee", coingecko-currency = "umee" }, | ||
{ denom = "ibc/E92E07E68705FAD13305EE9C73684B30A7B66A52F54C9890327E0A4C0F1D22E3", display-denom = "stcmdx", coingecko-currency = "comdex" }, | ||
] | ||
|
||
[[chains.consumers]] | ||
name = "neutron" | ||
lcd-endpoint = "https://api.neutron.quokkastake.io" | ||
chain-id = "neutron-1" | ||
base-denom = "untrn" | ||
bech-wallet-prefix = "neutron" | ||
bech-validator-prefix = "neutronvaloper" | ||
bech-consensus-prefix = "neutronvalcons" | ||
denoms = [ | ||
{ denom = "untrn", display-denom = "ntrn", coingecko-currency = "neutron" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[chains]] | ||
name = "sentinel" | ||
lcd-endpoint = "https://api.sentinel.quokkastake.io" | ||
base-denom = "udvpn" | ||
bech-wallet-prefix = "sent" | ||
denoms = [ | ||
{ denom = "udvpn", display-denom = "dvpn" } | ||
] | ||
validators = [ | ||
{ address = "sentvaloper1rw9wtyhsus7jvx55v3qv5nzun054ma6kz4237k" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
//nolint:paralleltest // disabled | ||
func TestValidateConfigNoConfigProvided(t *testing.T) { | ||
defer func() { | ||
if r := recover(); r == nil { | ||
require.Fail(t, "Expected to have a panic here!") | ||
} | ||
}() | ||
|
||
os.Args = []string{"cmd", "validate-config"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestValidateConfigFailedToLoad(t *testing.T) { | ||
defer func() { | ||
if r := recover(); r == nil { | ||
require.Fail(t, "Expected to have a panic here!") | ||
} | ||
}() | ||
|
||
os.Args = []string{"cmd", "validate-config", "--config", "../assets/config-not-found.toml"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestValidateConfigInvalid(t *testing.T) { | ||
defer func() { | ||
if r := recover(); r == nil { | ||
require.Fail(t, "Expected to have a panic here!") | ||
} | ||
}() | ||
|
||
os.Args = []string{"cmd", "validate-config", "--config", "../assets/config-invalid.toml"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestValidateConfigWithWarnings(t *testing.T) { | ||
os.Args = []string{"cmd", "validate-config", "--config", "../assets/config-with-warnings.toml"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestValidateConfigValid(t *testing.T) { | ||
os.Args = []string{"cmd", "validate-config", "--config", "../assets/config-valid.toml"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestStartNoConfigProvided(t *testing.T) { | ||
defer func() { | ||
if r := recover(); r == nil { | ||
require.Fail(t, "Expected to have a panic here!") | ||
} | ||
}() | ||
|
||
os.Args = []string{"cmd"} | ||
main() | ||
assert.True(t, true) | ||
} | ||
|
||
//nolint:paralleltest // disabled | ||
func TestStartConfigProvided(t *testing.T) { | ||
defer func() { | ||
if r := recover(); r == nil { | ||
require.Fail(t, "Expected to have a panic here!") | ||
} | ||
}() | ||
|
||
os.Args = []string{"cmd", "--config", "../assets/config-invalid.toml"} | ||
main() | ||
assert.True(t, true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.