Skip to content

Commit

Permalink
fix solana tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tok-kkk committed Mar 29, 2022
1 parent 354b8b7 commit 73a71f4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions chain/solana/solana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,29 @@ var _ = Describe("Solana", func() {

// The registry (in the CI test environment) is pre-populated with gateway
// addresses for BTC/toSolana selector.
zero := pack.NewU256FromU8(pack.U8(0)).Bytes32()
btcSelectorHash := [32]byte{}
copy(btcSelectorHash[:], crypto.Keccak256([]byte("BTC/toSolana")))
zero := pack.NewU256FromU8(pack.U8(0)).Bytes32()
lunaSelectorHash := [32]byte{}
copy(lunaSelectorHash[:], crypto.Keccak256([]byte("LUNA/toSolana")))
daiSelectorHash := [32]byte{}
copy(daiSelectorHash[:], crypto.Keccak256([]byte("DAI/toSolana")))

addrEncodeDecoder := solana.NewAddressEncodeDecoder()
expectedBtcGateway, _ := addrEncodeDecoder.DecodeAddress(multichain.Address("FDdKRjbBeFtyu5c66cZghJsTTjDTT1aD3zsgTWMTpaif"))
expectedBtcGateway, _ := addrEncodeDecoder.DecodeAddress("FDdKRjbBeFtyu5c66cZghJsTTjDTT1aD3zsgTWMTpaif")
expectedLunaGateway, _ := addrEncodeDecoder.DecodeAddress("3zfUUYDVp68fk9Z8FoKxEcEFqSMhE5UZ3Mw8mGhm5WRt")
expectedDaiGateway, _ := addrEncodeDecoder.DecodeAddress("rZJ8SoJBNWq8Qi6QTNTdVv78DPW6mn2fJUw7CPUvSgA")

Expect(registry.Count).To(Equal(uint64(3)))
Expect(registry.Selectors[0]).To(Equal(btcSelectorHash))
Expect(registry.Selectors[1]).To(Equal(zero))
Expect(registry.Selectors[1]).To(Equal(lunaSelectorHash))
Expect(registry.Selectors[2]).To(Equal(daiSelectorHash))
Expect(registry.Selectors[3]).To(Equal(zero))
Expect(len(registry.Selectors)).To(Equal(32))
Expect(registry.Gateways[0][:]).To(Equal([]byte(expectedBtcGateway)))
Expect(registry.Gateways[1]).To(Equal(zero))
Expect(registry.Gateways[1][:]).To(Equal([]byte(expectedLunaGateway)))
Expect(registry.Gateways[2][:]).To(Equal([]byte(expectedDaiGateway)))
Expect(registry.Gateways[3]).To(Equal(zero))
Expect(len(registry.Gateways)).To(Equal(32))
})
})
Expand Down

0 comments on commit 73a71f4

Please sign in to comment.