Skip to content

Commit 82a92ba

Browse files
authored
Update to Substrate v2.0.0 (ChainSafe#546)
- Upgrade GSRPC and subkey to v2.0.0 - Use MetadataV12 - Updates docker-compose to use chainbridge-substrate-chain v1.2.0
1 parent d695e19 commit 82a92ba

File tree

8 files changed

+15
-5
lines changed

8 files changed

+15
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ site/
2727
.env
2828
bridge
2929
keys/
30+
*.key
3031

3132
# Chainbridge
3233
config.toml

.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-rc6 && mv $HOME/bin/subkey-rc6 $HOME/bin/subkey && chmod +x $HOME/bin/subkey && subkey --version
19+
- wget -P $HOME/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0 && mv $HOME/bin/subkey-v2.0.0 $HOME/bin/subkey && chmod +x $HOME/bin/subkey && subkey --version
2020

2121
jobs:
2222
include:

chains/substrate/connection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (c *Connection) queryStorage(prefix, method string, arg1, arg2 []byte, resu
181181

182182
// TODO: Add this to GSRPC
183183
func getConst(meta *types.Metadata, prefix, name string, res interface{}) error {
184-
for _, mod := range meta.AsMetadataV11.Modules {
184+
for _, mod := range meta.AsMetadataV12.Modules {
185185
if string(mod.Name) == prefix {
186186
for _, cons := range mod.Constants {
187187
if string(cons.Name) == name {

docker-compose-e2e.yml

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

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

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/ChainSafe/chainbridge-utils v1.0.5
88
github.com/ChainSafe/log15 v1.0.0
99
github.com/aristanetworks/goarista v0.0.0-20200609010056-95bcf8053598 // indirect
10-
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible
10+
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible
1111
github.com/deckarep/golang-set v1.7.1 // indirect
1212
github.com/ethereum/go-ethereum v1.9.17
1313
github.com/gorilla/websocket v1.4.2 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible h1:QzF
6666
github.com/centrifuge/go-substrate-rpc-client v2.0.0-alpha.5+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
6767
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible h1:+H/LOoOMiAlww9xayOEAxa4mF6Tp+AgzzJDE9pQ37D8=
6868
github.com/centrifuge/go-substrate-rpc-client v2.0.0-rc6-0+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
69+
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible h1:FvPewruOgelqA/DVBdX7/Q6znUGGQ+g0ciG5tA2Fk98=
70+
github.com/centrifuge/go-substrate-rpc-client v2.0.0+incompatible/go.mod h1:GBMLH8MQs5g4FcrytcMm9uRgBnTL1LIkNTue6lUPhZU=
6971
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
7072
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
7173
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=

shared/substrate/events.go

+7
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ type EventMultisigCancelled struct {
117117
Topics []types.Hash
118118
}
119119

120+
type EventTreasuryMinting struct {
121+
Phase types.Phase
122+
Who types.AccountID
123+
Topics []types.Hash
124+
}
125+
120126
type Events struct {
121127
types.EventRecords
122128
events.Events
@@ -140,4 +146,5 @@ type Events struct {
140146
MultiAccount_MultisigApproval []EventMultisigApproval //nolint:stylecheck,golint
141147
MultiAccount_MultisigExecuted []EventMultisigExecuted //nolint:stylecheck,golint
142148
MultiAccount_MultisigCancelled []EventMultisigCancelled //nolint:stylecheck,golint
149+
TreasuryReward_TreasuryMinting []EventTreasuryMinting //nolint:stylecheck,gol
143150
}

shared/substrate/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func QueryStorage(client *Client, prefix, method string, arg1, arg2 []byte, resu
2020

2121
// TODO: Add to GSRPC
2222
func getConst(meta *types.Metadata, prefix, name string, res interface{}) error {
23-
for _, mod := range meta.AsMetadataV11.Modules {
23+
for _, mod := range meta.AsMetadataV12.Modules {
2424
if string(mod.Name) == prefix {
2525
for _, cons := range mod.Constants {
2626
if string(cons.Name) == name {

0 commit comments

Comments
 (0)