Skip to content

Commit

Permalink
Fix devnet for new contracts
Browse files Browse the repository at this point in the history
Change-Id: I5b7536884ce3d1bdf39a21a8b71b6a848ad0380f
  • Loading branch information
hendrikhofstadt authored and Leo committed Jul 2, 2021
1 parent f665fe4 commit 3c5deee
Show file tree
Hide file tree
Showing 12 changed files with 552 additions and 111 deletions.
4 changes: 3 additions & 1 deletion Dockerfile.agent
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo
cargo install --version =1.7.0 solana-cli && \
cargo install --version =2.0.12 spl-token-cli && \
cargo build --manifest-path ./bridge/Cargo.toml --package client --release && \
cargo build --manifest-path ./bridge/Cargo.toml --package agent --release && \
cp /usr/local/cargo/bin/solana /usr/local/bin && \
cp /usr/local/cargo/bin/spl-token /usr/local/bin && \
cp bridge/target/release/client /usr/local/bin
cp bridge/target/release/client /usr/local/bin && \
cp bridge/target/release/agent /usr/local/bin
3 changes: 1 addition & 2 deletions bridge/pkg/devnet/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ var (
GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1")

// Contracts (deployed by "truffle migrate" on a deterministic devnet)
GanacheAssetContractAddress = common.HexToAddress("0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab")
GanacheBridgeContractAddress = common.HexToAddress("0x5b1869D9A4C187F2EAa108f3062412ecf0526b24")
GanacheBridgeContractAddress = common.HexToAddress("0x254dffcd3277c0b1660f6d42efbb754edababc2b")

// ERC20 example tokens.
GanacheExampleERC20Token = common.HexToAddress("0xCfEB869F69431e42cdB54A4F4f105C19C080A601")
Expand Down
4 changes: 4 additions & 0 deletions bridge/pkg/devnet/guardianset_vaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func DevnetGuardianSetVSS(n uint) *vaa.VAA {
Version: 1,
GuardianSetIndex: 0,
Timestamp: time.Unix(5000, 0),
EmitterChain: 3,
EmitterAddress: vaa.Address{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
},
Payload: vaa.BodyGuardianSetUpdate{
Keys: pubkeys,
NewIndex: 1,
Expand Down
2 changes: 1 addition & 1 deletion bridge/pkg/vaa/payloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (b BodyGuardianSetUpdate) Serialize() []byte {
// Module
buf.Write(CoreModule)
// Action
MustWrite(buf, binary.BigEndian, uint8(1))
MustWrite(buf, binary.BigEndian, uint8(2))
// ChainID - 0 for universal
MustWrite(buf, binary.BigEndian, uint16(0))

Expand Down
1 change: 1 addition & 0 deletions bridge/pkg/vaa/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func (v *VAA) serializeBody() ([]byte, error) {
MustWrite(buf, binary.BigEndian, v.Nonce)
MustWrite(buf, binary.BigEndian, v.EmitterChain)
buf.Write(v.EmitterAddress[:])
MustWrite(buf, binary.BigEndian, v.Sequence)
buf.Write(v.Payload)

return buf.Bytes(), nil
Expand Down
1 change: 0 additions & 1 deletion devnet/eth-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
- --deterministic
- --time="1970-01-01T00:00:00+00:00"
- --host=0.0.0.0
- --port=7545
ports:
- containerPort: 8545
name: rpc
Expand Down
Loading

0 comments on commit 3c5deee

Please sign in to comment.