bridge: use new eth devnet addresses and keygen

This commit is contained in:
Leo 2020-08-19 17:38:55 +02:00
parent 59449a30b3
commit d1c86a0eaa
6 changed files with 28 additions and 23 deletions

View File

@ -35,4 +35,8 @@ Generate test ETH lockups once the cluster is up:
kubectl exec -it -c tests eth-devnet-0 -- npx truffle exec src/send-lockups.js kubectl exec -it -c tests eth-devnet-0 -- npx truffle exec src/send-lockups.js
Adjust number of nodes in running cluster:
tilt args -- --num=2
Once you're done, press Ctrl-C. Run `tilt down` to tear down the devnet. Once you're done, press Ctrl-C. Run `tilt down` to tear down the devnet.

View File

@ -1,3 +1,4 @@
// vaa-test generates VAA test fixtures used by the ETH devnet tests
package main package main
import ( import (

View File

@ -15,8 +15,8 @@ var (
GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1") GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1")
// Contracts (deployed by "truffle migrate" on a deterministic devnet) // Contracts (deployed by "truffle migrate" on a deterministic devnet)
WrappedAssetContractAddress = common.HexToAddress("0x79183957Be84C0F4dA451E534d5bA5BA3FB9c696") WrappedAssetContractAddress = common.HexToAddress("0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab")
BridgeContractAddress = common.HexToAddress("0xCfEB869F69431e42cdB54A4F4f105C19C080A601") BridgeContractAddress = common.HexToAddress("0x5b1869D9A4C187F2EAa108f3062412ecf0526b24")
) )
const ( const (

View File

@ -1,10 +1,8 @@
package devnet package devnet
import ( import (
"bytes"
"crypto/ecdsa" "crypto/ecdsa"
"crypto/elliptic" "crypto/elliptic"
"encoding/binary"
mathrand "math/rand" mathrand "math/rand"
"github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/crypto"
@ -12,12 +10,10 @@ import (
// DeterministicEcdsaKeyByIndex generates a deterministic ecdsa.PrivateKey from a given index. // DeterministicEcdsaKeyByIndex generates a deterministic ecdsa.PrivateKey from a given index.
func DeterministicEcdsaKeyByIndex(c elliptic.Curve, idx uint64) *ecdsa.PrivateKey { func DeterministicEcdsaKeyByIndex(c elliptic.Curve, idx uint64) *ecdsa.PrivateKey {
buf := make([]byte, 200) // use 555 as offset to deterministically generate key 0 to match vaa-test such that
binary.LittleEndian.PutUint64(buf, idx) // we generate the same key.
r := mathrand.New(mathrand.NewSource(int64(555 + idx)))
worstRNG := bytes.NewBuffer(buf) key, err := ecdsa.GenerateKey(c, r)
key, err := ecdsa.GenerateKey(c, bytes.NewReader(worstRNG.Bytes()))
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -56,19 +56,19 @@ spec:
# volumeMounts: # volumeMounts:
# - name: guardian-data # - name: guardian-data
# mountPath: /data # mountPath: /data
# - name: agent - name: agent
# image: solana-agent image: solana-agent
# command: command:
# - /usr/local/bin/agent - /usr/local/bin/agent
# - '11111111111111111111111111111111' # TODO: program address - '11111111111111111111111111111111' # TODO: program address
# - 'solana-devnet' # host - 'solana-devnet' # host
# - '8899' # rpc port - '8899' # rpc port
# - '8999' # pubsub/ws port - '8999' # pubsub/ws port
# - '9000' # grpc listen port - '9000' # grpc listen port
# ports: ports:
# - containerPort: 9000 - containerPort: 9000
# name: grpc name: grpc
# protocol: TCP protocol: TCP
# volumeClaimTemplates: # volumeClaimTemplates:
# - metadata: # - metadata:
# name: guardian-data # name: guardian-data

View File

@ -43,6 +43,10 @@ advanceBlock = () => {
}); });
} }
/*
The VAA test fixtures are generated by bridge/cmd/vaa-test.
*/
contract("Wormhole", function () { contract("Wormhole", function () {
it("should use master wrapped asset", async function () { it("should use master wrapped asset", async function () {
let bridge = await Wormhole.deployed(); let bridge = await Wormhole.deployed();