Skip to content

Commit

Permalink
Merge pull request #104 from renproject/feat/solana-updates
Browse files Browse the repository at this point in the history
update Solana FFI
  • Loading branch information
roynalnaruto authored Jun 15, 2021
2 parents d9d85a9 + 54bea9d commit fd7a680
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- uses: actions/setup-go@v2
with:
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -242,7 +242,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -490,7 +490,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -614,7 +614,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -741,7 +741,7 @@ jobs:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: d4c670dd402894b7e98a41bccf35d2d5066c573f
SOLANA_FFI_COMMIT: 1f85d47b5331a2146834bbd28a51654134aedd7d
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
Expand Down Expand Up @@ -859,4 +859,4 @@ jobs:
cd $GITHUB_WORKSPACE
go test \
-eth=true \
-timeout 1500s
-timeout 1500s
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 d4c670dd402894b7e98a41bccf35d2d5066c573f
RUN git checkout 1f85d47b5331a2146834bbd28a51654134aedd7d
RUN make clean && make
RUN go install ./...
4 changes: 2 additions & 2 deletions chain/ethereum/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
// A GasEstimator returns the gas price and the provide gas limit that is needed in
// order to confirm transactions with an estimated maximum delay of one block.
type GasEstimator struct {
client *Client
client *Client
}

// NewGasEstimator returns a simple gas estimator that fetches the ideal gas
// price for a ethereum transaction to be included in a block
// with minimal delay.
func NewGasEstimator(client *Client) *GasEstimator {
return &GasEstimator{
client: client,
client: client,
}
}

Expand Down
2 changes: 1 addition & 1 deletion chain/solana/solana-ffi
11 changes: 6 additions & 5 deletions chain/solana/solana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ var _ = Describe("Solana", func() {
binary.LittleEndian.PutUint64(calldata, burnCount)
data, err := client.CallContract(context.Background(), program, multichain.ContractCallData(calldata))
Expect(err).NotTo(HaveOccurred())
Expect(len(data)).To(Equal(41))

fetchedAmount := binary.LittleEndian.Uint64(data[:8])
recipientLen := uint8(data[8:9][0])
fetchedRecipient := pack.Bytes(data[9 : 9+int(recipientLen)])
Expect(fetchedAmount).To(Equal(burnAmount))
Expect(len(data)).To(Equal(65))
fetchedAmount := [32]byte{}
copy(fetchedAmount[:], data[0:32])
recipientLen := uint8(data[32:33][0])
fetchedRecipient := pack.Bytes(data[33 : 33+int(recipientLen)])
Expect(pack.NewU256(fetchedAmount)).To(Equal(pack.NewU256FromUint64(burnAmount)))
Expect([]byte(fetchedRecipient)).To(Equal([]byte(recipientRawAddr)))
})
})
Expand Down
9 changes: 9 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ github.com/filecoin-project/specs-actors/v3 v3.1.0 h1:s4qiPw8pgypqBGAy853u/zdZJ7
github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww=
github.com/filecoin-project/specs-actors/v4 v4.0.0 h1:vMALksY5G3J5rj3q9rbcyB+f4Tk1xrLqSgdB3jOok4s=
github.com/filecoin-project/specs-actors/v4 v4.0.0/go.mod h1:TkHXf/l7Wyw4ZejyXIPS2rK8bBO0rdwhTZyQQgaglng=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57 h1:N6IBsnGXfAMXd677G6EiOKewFwQ7Ulcuupi4U6wYmXE=
github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57/go.mod h1:283yBMMUSDB2abcjP/hhrwTkhb9h3sfM6KGrep/ZlBI=
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw=
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
Expand Down Expand Up @@ -1772,6 +1774,7 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7V
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f h1:nMhj+x/m7ZQsHBz0L3gpytp0v6ogokdbrQDnhB8Kh7s=
github.com/xlab/c-for-go v0.0.0-20201002084316-c134bfab968f/go.mod h1:h/1PEBwj7Ym/8kOuMWvO2ujZ6Lt+TMbySEXNhjjR87I=
github.com/xlab/c-for-go v0.0.0-20201112171043-ea6dce5809cb/go.mod h1:pbNsDSxn1ICiNn9Ct4ZGNrwzfkkwYbx/lw8VuyutFIg=
github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245 h1:Sw125DKxZhPUI4JLlWugkzsrlB50jR9v2khiD9FxuSo=
github.com/xlab/pkgconfig v0.0.0-20170226114623-cea12a0fd245/go.mod h1:C+diUUz7pxhNY6KAoLgrTYARGWnt82zWTylZlxT92vk=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
Expand Down Expand Up @@ -1879,6 +1882,7 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45mi
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -2128,6 +2132,7 @@ golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200711155855-7342f9734a7d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3 h1:r3P/5xOq/dK1991B65Oy6E1fRF/2d/fSYZJ/fXGVfJc=
golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20201112185108-eeaa07dd7696/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -2274,8 +2279,12 @@ howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqp
howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0=
modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8=
modernc.org/golex v1.0.0 h1:wWpDlbK8ejRfSyi0frMyhilD3JBvtcx2AdGDnU+JtsE=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254=
modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk=
modernc.org/lexer v1.0.0/go.mod h1:F/Dld0YKYdZCLQ7bD0USbWL4YKCyTDRDHiDTOs0q0vk=
modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE=
modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/strutil v1.1.0 h1:+1/yCzZxY2pZwwrsbH+4T7BQMoLQ9QiBshRC9eicYsc=
Expand Down

0 comments on commit fd7a680

Please sign in to comment.