Skip to content

Commit

Permalink
client/eth: Use bytes as string in key import.
Browse files Browse the repository at this point in the history
Also set the simnet contract address.
  • Loading branch information
JoeGruffins committed Dec 8, 2021
1 parent 2d6d4cb commit d275c56
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions client/asset/eth/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package eth
import (
"bytes"
"crypto/ecdsa"
"encoding/hex"
"encoding/json"
"fmt"
"os"
Expand Down Expand Up @@ -271,7 +270,7 @@ func importKeyToNode(node *node.Node, privateKey, password []byte) error {
ks := backends[0].(*keystore.KeyStore)
accounts := ks.Accounts()
if len(accounts) == 0 {
_, err = ks.ImportECDSA(ecdsaPrivateKey, hex.EncodeToString(password))
_, err = ks.ImportECDSA(ecdsaPrivateKey, string(password))
return err
} else if len(accounts) == 1 {
address := crypto.PubkeyToAddress(ecdsaPrivateKey.PublicKey)
Expand Down
3 changes: 1 addition & 2 deletions client/asset/eth/nodeclient_harness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,10 @@ func setupWallet(walletDir, seed, listenAddress string) error {
"nodelistenaddr": listenAddress,
}
seedB, _ := hex.DecodeString(seed)
walletPass, _ := hex.DecodeString(pw)
createWalletParams := asset.CreateWalletParams{
Type: walletTypeGeth,
Seed: seedB,
Pass: walletPass,
Pass: []byte(pw),
Settings: settings,
DataDir: walletDir,
Net: dex.Simnet,
Expand Down
2 changes: 1 addition & 1 deletion client/cmd/dexcctl/simnet-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi

if [ $ETH_ON -eq 0 ]; then
echo configuring Eth wallet
./dexcctl -p abc -p "" --simnet newwallet 60 geth "" '{"appDir":"~/dextest/eth/testnode"}'
./dexcctl -p abc -p "" --simnet newwallet 60 geth
fi

echo registering with DEX
Expand Down
2 changes: 1 addition & 1 deletion dex/networks/eth/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
ContractAddresses = map[uint32]map[dex.Network]common.Address{
0: {
dex.Mainnet: common.Address{},
dex.Simnet: common.Address{},
dex.Simnet: common.HexToAddress("0x2f68e723b8989ba1c6a9f03e42f33cb7dc9d606f"),
dex.Testnet: common.Address{},
},
}
Expand Down

0 comments on commit d275c56

Please sign in to comment.