@@ -4,37 +4,45 @@ import (
44 "os"
55 "testing"
66
7- "github.com/NibiruChain/nibiru/app "
7+ "github.com/NibiruChain/nibiru/v2/gosdk "
88 "github.com/stretchr/testify/require"
99)
1010
1111func init () {
12- app . SetPrefixes ( app . AccountAddressPrefix )
12+ gosdk . EnsureNibiruPrefix ( )
1313}
1414
1515func TestConfig_Get (t * testing.T ) {
16- os .Setenv ("CHAIN_ID" , "nibiru-localnet-0" )
17- os .Setenv ("GRPC_ENDPOINT" , "localhost:9090" )
18- os .Setenv ("WEBSOCKET_ENDPOINT" , "ws://localhost:26657/websocket" )
19- os .Setenv ("FEEDER_MNEMONIC" , "earth wash broom grow recall fitness" )
20- os .Setenv (
21- "EXCHANGE_SYMBOLS_MAP" ,
22- "{\" bitfinex\" : {\" ubtc:unusd\" : \" tBTCUSD\" , \" ueth:unusd\" : \" tETHUSD\" , \" uusd:unusd\" : \" tUSTUSD\" }}" ,
23- )
24- os .Setenv ("VALIDATOR_ADDRESS" , "nibivaloper1d7zygazerfwx4l362tnpcp0ramzm97xvv9ryxr" )
25- os .Setenv ("ETHEREUM_RPC_ENDPOINT" , "https://mainnet.infura.io/v3/DUMMY_INFURA_KEY" )
16+ for _ , err := range []error {
17+ os .Setenv ("CHAIN_ID" , "nibiru-localnet-0" ),
18+ os .Setenv ("GRPC_ENDPOINT" , "localhost:9090" ),
19+ os .Setenv ("WEBSOCKET_ENDPOINT" , "ws://localhost:26657/websocket" ),
20+ os .Setenv ("FEEDER_MNEMONIC" , "earth wash broom grow recall fitness" ),
21+ os .Setenv (
22+ "EXCHANGE_SYMBOLS_MAP" ,
23+ "{\" bitfinex\" : {\" ubtc:unusd\" : \" tBTCUSD\" , \" ueth:unusd\" : \" tETHUSD\" , \" uusd:unusd\" : \" tUSTUSD\" }}" ,
24+ ),
25+ os .Setenv ("VALIDATOR_ADDRESS" , "nibivaloper1d7zygazerfwx4l362tnpcp0ramzm97xvv9ryxr" ),
26+ os .Setenv ("ETHEREUM_RPC_ENDPOINT" , "https://mainnet.infura.io/v3/DUMMY_INFURA_KEY" ),
27+ } {
28+ require .NoError (t , err )
29+ }
2630 _ , err := Get ()
2731 require .NoError (t , err )
2832}
2933
3034func TestConfig_Without_EXCHANGE_SYMBOLS_MAP (t * testing.T ) {
31- os .Unsetenv ("EXCHANGE_SYMBOLS_MAP" )
32- os .Setenv ("CHAIN_ID" , "nibiru-localnet-0" )
33- os .Setenv ("GRPC_ENDPOINT" , "localhost:9090" )
34- os .Setenv ("WEBSOCKET_ENDPOINT" , "ws://localhost:26657/websocket" )
35- os .Setenv ("FEEDER_MNEMONIC" , "earth wash broom grow recall fitness" )
36- os .Setenv ("VALIDATOR_ADDRESS" , "nibivaloper1d7zygazerfwx4l362tnpcp0ramzm97xvv9ryxr" )
37- os .Setenv ("ETHEREUM_RPC_ENDPOINT" , "https://mainnet.infura.io/v3/DUMMY_INFURA_KEY" )
35+ for _ , err := range []error {
36+ os .Unsetenv ("EXCHANGE_SYMBOLS_MAP" ),
37+ os .Setenv ("CHAIN_ID" , "nibiru-localnet-0" ),
38+ os .Setenv ("GRPC_ENDPOINT" , "localhost:9090" ),
39+ os .Setenv ("WEBSOCKET_ENDPOINT" , "ws://localhost:26657/websocket" ),
40+ os .Setenv ("FEEDER_MNEMONIC" , "earth wash broom grow recall fitness" ),
41+ os .Setenv ("VALIDATOR_ADDRESS" , "nibivaloper1d7zygazerfwx4l362tnpcp0ramzm97xvv9ryxr" ),
42+ os .Setenv ("ETHEREUM_RPC_ENDPOINT" , "https://mainnet.infura.io/v3/DUMMY_INFURA_KEY" ),
43+ } {
44+ require .NoError (t , err )
45+ }
3846 _ , err := Get ()
3947 require .NoError (t , err )
4048}
0 commit comments