diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4117676..dc5946a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -119,7 +119,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -245,7 +245,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -370,7 +370,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -447,7 +447,7 @@ jobs: git clone https://github.com/renproject/solana-ffi.git cd solana-ffi git checkout ${{ env.SOLANA_FFI_COMMIT }} - make clean + eval `ssh-agent -s` make - name: Run vetting @@ -495,7 +495,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -620,7 +620,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -747,7 +747,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -871,7 +871,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -995,7 +995,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -1119,7 +1119,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 @@ -1243,7 +1243,7 @@ jobs: runs-on: ubuntu-latest env: FILECOIN_FFI_COMMIT: 7912389334e347bbb2eac0520c836830875c39de - SOLANA_FFI_COMMIT: ca488a932fea16a4fc09456383c10aa22a6b8585 + SOLANA_FFI_COMMIT: 720c0143d8655bfcd412ae73c949474df2c1dcf3 steps: - name: Set up Go 1.16 uses: actions/setup-go@v1 diff --git a/Dockerfile b/Dockerfile index add0c094..8fbdce83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,6 @@ RUN mkdir -p src/github.com/renproject WORKDIR $GOPATH/src/github.com/renproject RUN git clone https://github.com/renproject/solana-ffi WORKDIR $GOPATH/src/github.com/renproject/solana-ffi -RUN git checkout ca488a932fea16a4fc09456383c10aa22a6b8585 +RUN git checkout 720c0143d8655bfcd412ae73c949474df2c1dcf3 RUN make clean && make RUN go install ./... diff --git a/chain/solana/solana-ffi b/chain/solana/solana-ffi index ca488a93..720c0143 160000 --- a/chain/solana/solana-ffi +++ b/chain/solana/solana-ffi @@ -1 +1 @@ -Subproject commit ca488a932fea16a4fc09456383c10aa22a6b8585 +Subproject commit 720c0143d8655bfcd412ae73c949474df2c1dcf3 diff --git a/chain/solana/solana_test.go b/chain/solana/solana_test.go index 9bb0c110..42fc2c48 100644 --- a/chain/solana/solana_test.go +++ b/chain/solana/solana_test.go @@ -64,7 +64,7 @@ var _ = Describe("Solana", func() { time.Sleep(10 * time.Second) recipient := []byte("mwjUmhAW68zCtgZpW5b1xD5g7MZew6xPV4") Expect(err).NotTo(HaveOccurred()) - burnCount := cgo.GatewayGetBurnCount(solana.DefaultClientRPCURL) + burnCount := cgo.GatewayGetBurnCount(solana.DefaultClientRPCURL, selector) burnAmount := uint64(500000000) // 5 tokens. burnSig := cgo.GatewayBurn(keypairPath, solana.DefaultClientRPCURL, selector, burnCount, burnAmount, uint32(len(recipient)), recipient) logger.Debug("Burn", zap.String("tx signature", string(burnSig))) @@ -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(1))) + 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)) }) })