Skip to content

Commit

Permalink
test: fix test for icon keys (#143)
Browse files Browse the repository at this point in the history
* test: fix test for icon keys

* test: fix tests

* chore: change addr for cosmos

* chore: update keystore path for relayer docker image

---------

Co-authored-by: izyak <[email protected]>
  • Loading branch information
izyak and izyak authored Aug 16, 2023
1 parent 8b397bf commit 4ae7d45
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
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

0 comments on commit 4ae7d45

Please sign in to comment.