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

Commit

Permalink
New GSRPC and substrate chain rc6 version (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiquantum committed Oct 5, 2020
1 parent b1cc4f9 commit 4a8a466
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ install:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo apt-get install ethereum
- wget -P $HOME/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey && chmod +x $HOME/bin/subkey && subkey --version
- 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

jobs:
include:
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ RUN cd cmd/chainbridge && go build -o /bridge .
# # final stage
FROM debian:stretch-slim
RUN apt-get -y update && apt-get -y upgrade && apt-get install ca-certificates wget -y
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey && chmod +x /usr/local/bin/subkey
RUN wget -P /usr/local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-rc6 \
&& mv /usr/local/bin/subkey-rc6 /usr/local/bin/subkey \
&& chmod +x /usr/local/bin/subkey
RUN subkey --version

COPY --from=builder /bridge ./
Expand Down
13 changes: 7 additions & 6 deletions chains/substrate/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ func (c *Connection) SubmitTx(method utils.Method, args ...interface{}) error {

// Sign the extrinsic
o := types.SignatureOptions{
BlockHash: c.genesisHash,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: c.genesisHash,
Nonce: types.NewUCompactFromUInt(uint64(c.nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
BlockHash: c.genesisHash,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: c.genesisHash,
Nonce: types.NewUCompactFromUInt(uint64(c.nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
TransactionVersion: 1,
}

err = ext.Sign(*c.key, o)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ services:
- "8546:8545"

sub-chain:
image: "chainsafe/chainbridge-substrate-chain:v1.0.0"
image: "chainsafe/chainbridge-substrate-chain:v1.1.0"
container_name: sub-chain
command: chainbridge-substrate-chain --dev --alice --ws-external --rpc-external
ports:
- "9944:9944"
- "9944:9944"
2 changes: 1 addition & 1 deletion e2e/fungible_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func testErc20SubstrateRoundTrip(t *testing.T, ctx *testContext) {
// Repeat the process in the opposite direction
expectedEthBalance = ethtest.Erc20BalanceOf(t, ctx.ethA.Client, ctx.ethA.TestContracts.Erc20Sub, ethRecipient)
expectedSubBalance = subtest.BalanceOf(t, ctx.subClient, subRecipient)
feePerTx := big.NewInt(10143)
feePerTx := big.NewInt(125000143)
nonce = subtest.GetDepositNonce(t, ctx.subClient, EthAChainId) + 1

log.Info("Asserted resulting balance", "owner", ethRecipient, "balance", expectedEthBalance.String())
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ require (
github.com/ChainSafe/chainbridge-utils v1.0.3
github.com/ChainSafe/log15 v1.0.0
github.com/aristanetworks/goarista v0.0.0-20200609010056-95bcf8053598 // indirect
github.com/btcsuite/btcd v0.20.1-beta // indirect
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/ethereum/go-ethereum v1.9.17
github.com/gorilla/websocket v1.4.2 // indirect
Expand All @@ -17,5 +16,4 @@ require (
github.com/stretchr/testify v1.4.0
github.com/urfave/cli/v2 v2.2.0
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect
)
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ChainSafe/chainbridge-substrate-events v0.0.0-20200715141113-87198532025e h1:c7NSjEfp13ua566bC2KSNmyx0Cvj1cciO2klsFIQv2I=
github.com/ChainSafe/chainbridge-substrate-events v0.0.0-20200715141113-87198532025e/go.mod h1:H5fNH57wn/j1oLifOnWEqYbfJZcOWzr7jZjKKrUckSQ=
github.com/ChainSafe/chainbridge-utils v1.0.1 h1:qxg0So8/XsiixiHCeZ2tn69IM7aGevhwRNby+xAfWGs=
github.com/ChainSafe/chainbridge-utils v1.0.1/go.mod h1:jX+LT1patbRwukvjQl/4oJsKZvx3ujZubdXz8ZWlMXo=
github.com/ChainSafe/chainbridge-utils v1.0.2 h1:4HaFV0H7oiIB1TlV1AjH/kYu+3GBYgNsvovpNstI3iI=
github.com/ChainSafe/chainbridge-utils v1.0.2/go.mod h1:T5cOZhxdY4x0DrE0EqOnMwAPE8d4bNGqiPfN16o1rzc=
github.com/ChainSafe/chainbridge-utils v1.0.3 h1:a8pa5N11uo2wzgzNV9QkSocFrbkO+HiWCiihKDnkuAg=
github.com/ChainSafe/chainbridge-utils v1.0.3/go.mod h1:T5cOZhxdY4x0DrE0EqOnMwAPE8d4bNGqiPfN16o1rzc=
github.com/ChainSafe/log15 v1.0.0 h1:vRDVtWtVwIH5uSCBvgTTZh6FA58UBJ6+QiiypaZfBf8=
github.com/ChainSafe/log15 v1.0.0/go.mod h1:5v1+ALHtdW0NfAeeoYyKmzCAMcAeqkdhIg4uxXWIgOg=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down Expand Up @@ -66,6 +64,8 @@ github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.3+incompatible h1:d8h
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.3+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible h1:QzFk38HaqnzjQ6DHra5WxcTf+KxbB0Hitg+72LEPVJI=
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible h1:+H/LOoOMiAlww9xayOEAxa4mF6Tp+AgzzJDE9pQ37D8=
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
Expand Down
26 changes: 14 additions & 12 deletions shared/substrate/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ func SubmitTx(client *Client, method Method, args ...interface{}) error {

// Sign the extrinsic
o := types.SignatureOptions{
BlockHash: client.Genesis,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: client.Genesis,
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
BlockHash: client.Genesis,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: client.Genesis,
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
TransactionVersion: 1,
}
err = ext.Sign(*client.Key, o)
if err != nil {
Expand Down Expand Up @@ -96,12 +97,13 @@ func BatchSubmit(client *Client, calls []types.Call) error {

// Sign the extrinsic
o := types.SignatureOptions{
BlockHash: client.Genesis,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: client.Genesis,
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
BlockHash: client.Genesis,
Era: types.ExtrinsicEra{IsMortalEra: false},
GenesisHash: client.Genesis,
Nonce: types.NewUCompactFromUInt(uint64(acct.Nonce)),
SpecVersion: rv.SpecVersion,
Tip: types.NewUCompactFromUInt(0),
TransactionVersion: 1,
}

wg := &sync.WaitGroup{}
Expand Down

0 comments on commit 4a8a466

Please sign in to comment.