Skip to content
This repository was archived by the owner on Jul 13, 2022. It is now read-only.

Commit 4a8a466

Browse files
authored
New GSRPC and substrate chain rc6 version (#528)
1 parent b1cc4f9 commit 4a8a466

File tree

8 files changed

+34
-31
lines changed

8 files changed

+34
-31
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ install:
1616
- sudo add-apt-repository -y ppa:ethereum/ethereum
1717
- sudo apt-get update
1818
- sudo apt-get install ethereum
19-
- wget -P $HOME/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey && chmod +x $HOME/bin/subkey && subkey --version
19+
- wget -P $HOME/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 && mv $HOME/bin/subkey-rc6 $HOME/bin/subkey && chmod +x $HOME/bin/subkey && subkey --version
2020

2121
jobs:
2222
include:

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ RUN cd cmd/chainbridge && go build -o /bridge .
1010
# # final stage
1111
FROM debian:stretch-slim
1212
RUN apt-get -y update && apt-get -y upgrade && apt-get install ca-certificates wget -y
13-
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey && chmod +x /usr/local/bin/subkey
13+
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 \
14+
&& mv /usr/local/bin/subkey-rc6 /usr/local/bin/subkey \
15+
&& chmod +x /usr/local/bin/subkey
1416
RUN subkey --version
1517

1618
COPY --from=builder /bridge ./

chains/substrate/connection.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,13 @@ func (c *Connection) SubmitTx(method utils.Method, args ...interface{}) error {
116116

117117
// Sign the extrinsic
118118
o := types.SignatureOptions{
119-
BlockHash: c.genesisHash,
120-
Era: types.ExtrinsicEra{IsMortalEra: false},
121-
GenesisHash: c.genesisHash,
122-
Nonce: types.NewUCompactFromUInt(uint64(c.nonce)),
123-
SpecVersion: rv.SpecVersion,
124-
Tip: types.NewUCompactFromUInt(0),
119+
BlockHash: c.genesisHash,
120+
Era: types.ExtrinsicEra{IsMortalEra: false},
121+
GenesisHash: c.genesisHash,
122+
Nonce: types.NewUCompactFromUInt(uint64(c.nonce)),
123+
SpecVersion: rv.SpecVersion,
124+
Tip: types.NewUCompactFromUInt(0),
125+
TransactionVersion: 1,
125126
}
126127

127128
err = ext.Sign(*c.key, o)

docker-compose-e2e.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ services:
1616
- "8546:8545"
1717

1818
sub-chain:
19-
image: "chainsafe/chainbridge-substrate-chain:v1.0.0"
19+
image: "chainsafe/chainbridge-substrate-chain:v1.1.0"
2020
container_name: sub-chain
2121
command: chainbridge-substrate-chain --dev --alice --ws-external --rpc-external
2222
ports:
23-
- "9944:9944"
23+
- "9944:9944"

e2e/fungible_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func testErc20SubstrateRoundTrip(t *testing.T, ctx *testContext) {
151151
// Repeat the process in the opposite direction
152152
expectedEthBalance = ethtest.Erc20BalanceOf(t, ctx.ethA.Client, ctx.ethA.TestContracts.Erc20Sub, ethRecipient)
153153
expectedSubBalance = subtest.BalanceOf(t, ctx.subClient, subRecipient)
154-
feePerTx := big.NewInt(10143)
154+
feePerTx := big.NewInt(125000143)
155155
nonce = subtest.GetDepositNonce(t, ctx.subClient, EthAChainId) + 1
156156

157157
log.Info("Asserted resulting balance", "owner", ethRecipient, "balance", expectedEthBalance.String())

go.mod

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ require (
77
github.com/ChainSafe/chainbridge-utils v1.0.3
88
github.com/ChainSafe/log15 v1.0.0
99
github.com/aristanetworks/goarista v0.0.0-20200609010056-95bcf8053598 // indirect
10-
github.com/btcsuite/btcd v0.20.1-beta // indirect
11-
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible
10+
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible
1211
github.com/deckarep/golang-set v1.7.1 // indirect
1312
github.com/ethereum/go-ethereum v1.9.17
1413
github.com/gorilla/websocket v1.4.2 // indirect
@@ -17,5 +16,4 @@ require (
1716
github.com/stretchr/testify v1.4.0
1817
github.com/urfave/cli/v2 v2.2.0
1918
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
20-
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
21-
)
19+
)

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt
1515
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
1616
github.com/ChainSafe/chainbridge-substrate-events v0.0.0-20200715141113-87198532025e h1:c7NSjEfp13ua566bC2KSNmyx0Cvj1cciO2klsFIQv2I=
1717
github.com/ChainSafe/chainbridge-substrate-events v0.0.0-20200715141113-87198532025e/go.mod h1:H5fNH57wn/j1oLifOnWEqYbfJZcOWzr7jZjKKrUckSQ=
18-
github.com/ChainSafe/chainbridge-utils v1.0.1 h1:qxg0So8/XsiixiHCeZ2tn69IM7aGevhwRNby+xAfWGs=
19-
github.com/ChainSafe/chainbridge-utils v1.0.1/go.mod h1:jX+LT1patbRwukvjQl/4oJsKZvx3ujZubdXz8ZWlMXo=
20-
github.com/ChainSafe/chainbridge-utils v1.0.2 h1:4HaFV0H7oiIB1TlV1AjH/kYu+3GBYgNsvovpNstI3iI=
21-
github.com/ChainSafe/chainbridge-utils v1.0.2/go.mod h1:T5cOZhxdY4x0DrE0EqOnMwAPE8d4bNGqiPfN16o1rzc=
18+
github.com/ChainSafe/chainbridge-utils v1.0.3 h1:a8pa5N11uo2wzgzNV9QkSocFrbkO+HiWCiihKDnkuAg=
19+
github.com/ChainSafe/chainbridge-utils v1.0.3/go.mod h1:T5cOZhxdY4x0DrE0EqOnMwAPE8d4bNGqiPfN16o1rzc=
2220
github.com/ChainSafe/log15 v1.0.0 h1:vRDVtWtVwIH5uSCBvgTTZh6FA58UBJ6+QiiypaZfBf8=
2321
github.com/ChainSafe/log15 v1.0.0/go.mod h1:5v1+ALHtdW0NfAeeoYyKmzCAMcAeqkdhIg4uxXWIgOg=
2422
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
@@ -66,6 +64,8 @@ github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.3+incompatible h1:d8h
6664
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.3+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
6765
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible h1:QzFk38HaqnzjQ6DHra5WxcTf+KxbB0Hitg+72LEPVJI=
6866
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
67+
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible h1:+H/LOoOMiAlww9xayOEAxa4mF6Tp+AgzzJDE9pQ37D8=
68+
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
6969
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
7070
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
7171
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=

shared/substrate/submit.go

+14-12
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ func SubmitTx(client *Client, method Method, args ...interface{}) error {
3838

3939
// Sign the extrinsic
4040
o := types.SignatureOptions{
41-
BlockHash: client.Genesis,
42-
Era: types.ExtrinsicEra{IsMortalEra: false},
43-
GenesisHash: client.Genesis,
44-
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
45-
SpecVersion: rv.SpecVersion,
46-
Tip: types.NewUCompactFromUInt(0),
41+
BlockHash: client.Genesis,
42+
Era: types.ExtrinsicEra{IsMortalEra: false},
43+
GenesisHash: client.Genesis,
44+
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
45+
SpecVersion: rv.SpecVersion,
46+
Tip: types.NewUCompactFromUInt(0),
47+
TransactionVersion: 1,
4748
}
4849
err = ext.Sign(*client.Key, o)
4950
if err != nil {
@@ -96,12 +97,13 @@ func BatchSubmit(client *Client, calls []types.Call) error {
9697

9798
// Sign the extrinsic
9899
o := types.SignatureOptions{
99-
BlockHash: client.Genesis,
100-
Era: types.ExtrinsicEra{IsMortalEra: false},
101-
GenesisHash: client.Genesis,
102-
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
103-
SpecVersion: rv.SpecVersion,
104-
Tip: types.NewUCompactFromUInt(0),
100+
BlockHash: client.Genesis,
101+
Era: types.ExtrinsicEra{IsMortalEra: false},
102+
GenesisHash: client.Genesis,
103+
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
104+
SpecVersion: rv.SpecVersion,
105+
Tip: types.NewUCompactFromUInt(0),
106+
TransactionVersion: 1,
105107
}
106108

107109
wg := &sync.WaitGroup{}

0 commit comments

Comments
 (0)