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

test: fix test for icon keys #143

Merged
merged 4 commits into from
Aug 16, 2023
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ USER relayer

WORKDIR /home/relayer

COPY ./env/godWallet.json ./keys/godwallet.json
COPY ./env/ibc-icon/godWallet.json ./keys/godwallet.json

CMD ["/bin/rly"]
File renamed without changes.
1 change: 0 additions & 1 deletion env/password

This file was deleted.

10 changes: 4 additions & 6 deletions relayer/chains/icon/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io/ioutil"
"path/filepath"
"testing"
"time"

Expand All @@ -26,11 +25,10 @@ func NewTestClient() *Client {

func GetLisbonIconProvider(network_id int, contractAddress string) *IconProvider {

absPath, _ := filepath.Abs("../../../env/godWallet.json")

pcfg := IconProviderConfig{
Keystore: absPath,
ChainID: "icon",
Keystore: "godWallet",
KeyDirectory: "../../../env",
ChainID: "ibc-icon",
Password: "gochain",
ICONNetworkID: 2,
BTPNetworkID: int64(network_id),
Expand All @@ -49,7 +47,7 @@ func GetLisbonIconProvider(network_id int, contractAddress string) *IconProvider

func getTestWallet() (module.Wallet, error) {

keyStore_file := "../../../env/godWallet.json"
keyStore_file := "../../../env/ibc-icon/godWallet.json"
kpass := "gochain"

keystore_bytes, err := ioutil.ReadFile(keyStore_file)
Expand Down
4 changes: 4 additions & 0 deletions relayer/chains/icon/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ func TestCreateKeystore(t *testing.T) {
kwName := "testWallet.json"
p := &IconProvider{
client: NewClient(ENDPOINT, &zap.Logger{}),
PCfg: &IconProviderConfig{
KeyDirectory: "../../../env",
ChainID: "ibc-icon",
},
}
err := p.CreateKeystore(kwName)
require.NoError(t, err)
Expand Down
9 changes: 5 additions & 4 deletions relayer/chains/wasm/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ func TestGetAddress(t *testing.T) {
assert.NoError(t, err)
pArch := p.(*WasmProvider)
assert.NoError(t, err)
a := "archway1jpdcgkwv7wmwaqc6lyvd82dwhkxxfvplp6u8gw"
// prefix will be setup when querying a contract or doing a txn, not when provider is initialized
a := "cosmos1jpdcgkwv7wmwaqc6lyvd82dwhkxxfvpl53qrze"
addr, err := pArch.GetKeyAddress()
assert.NoError(t, err)
assert.Equal(t, a, addr.String())
Expand Down Expand Up @@ -381,10 +382,10 @@ func TestSerializeAny(t *testing.T) {

func GetIconProvider(network_id int) *icon.IconProvider {

absPath, _ := filepath.Abs("../../../env/godWallet.json")

pcfg := icon.IconProviderConfig{
Keystore: absPath,
Keystore: "godWallet",
KeyDirectory: "../../../env",
ChainID: "ibc-icon",
Password: "gochain",
ICONNetworkID: 3,
BTPNetworkID: int64(network_id),
Expand Down
Loading