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
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.

View File

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

View File

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

View File

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

View File

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

View File

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