Skip to content

Commit 1b20de9

Browse files
authored
Merge pull request #9 from pendulum-chain/219-update-runtimes-to-polkadot-v0940
update version of substrate dependencies to polkadot v0940
2 parents e7068e1 + 514ad70 commit 1b20de9

14 files changed

Lines changed: 1775 additions & 1322 deletions

File tree

Cargo.lock

Lines changed: 1630 additions & 1184 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,51 +23,51 @@ futures = { version = "0.3.21", features = ["thread-pool"]}
2323
dia-oracle-rpc = { version ="0.1.0", path = "../pallets/dia-oracle/rpc" }
2424
dia-oracle-runtime-api = { version ="0.1.0", path = "../pallets/dia-oracle/rpc/runtime-api" }
2525

26-
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
27-
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
28-
sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
29-
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
30-
sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
31-
sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
32-
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
33-
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
34-
sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
35-
sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
36-
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
37-
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
38-
sc-finality-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
39-
sp-finality-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
40-
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
41-
sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
42-
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
43-
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
44-
sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
45-
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
46-
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
26+
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
27+
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
28+
sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
29+
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
30+
sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
31+
sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
32+
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
33+
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
34+
sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
35+
sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
36+
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
37+
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
38+
sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
39+
sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
40+
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
41+
sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
42+
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
43+
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
44+
sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
45+
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
46+
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
4747

4848
# These dependencies are used for the node template's RPCs
4949
jsonrpsee = { version = "0.16.2", features = ["server"] }
50-
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
51-
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
52-
sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
53-
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
54-
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
55-
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
56-
substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
57-
pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
50+
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
51+
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
52+
sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
53+
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
54+
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
55+
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
56+
substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
57+
pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
5858

5959
# These dependencies are used for runtime benchmarking
60-
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
61-
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
60+
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
61+
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
6262

6363
# Local Dependencies
6464
node-template-runtime = { version = "4.0.0-dev", path = "../runtime" }
6565

6666
# CLI-specific dependencies
67-
try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
67+
try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
6868

6969
[build-dependencies]
70-
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.37" }
70+
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", "branch" = "polkadot-v0.9.40" }
7171

7272
[features]
7373
default = []

node/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use node_template_runtime::{
55
use sc_service::ChainType;
66
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
77
use sp_core::{sr25519, Pair, Public};
8-
use sp_finality_grandpa::AuthorityId as GrandpaId;
8+
use sp_consensus_grandpa::AuthorityId as GrandpaId;
99
use sp_runtime::traits::{IdentifyAccount, Verify};
1010

1111
// The URL for the telemetry server.

node/src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn run() -> sc_cli::Result<()> {
100100
let PartialComponents { client, task_manager, backend, .. } =
101101
service::new_partial(&config)?;
102102
let aux_revert = Box::new(|client, _, blocks| {
103-
sc_finality_grandpa::revert(client, blocks)?;
103+
sc_consensus_grandpa::revert(client, blocks)?;
104104
Ok(())
105105
});
106106
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))

node/src/service.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use node_template_runtime::{self, opaque::Block, RuntimeApi};
44
use sc_client_api::BlockBackend;
55
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
66
pub use sc_executor::NativeElseWasmExecutor;
7-
use sc_finality_grandpa::SharedVoterState;
7+
use sc_consensus_grandpa::SharedVoterState;
88
use sc_keystore::LocalKeystore;
9-
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
9+
use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams};
1010
use sc_telemetry::{Telemetry, TelemetryWorker};
1111
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
1212
use std::{sync::Arc, time::Duration};
@@ -46,13 +46,13 @@ pub fn new_partial(
4646
sc_consensus::DefaultImportQueue<Block, FullClient>,
4747
sc_transaction_pool::FullPool<Block, FullClient>,
4848
(
49-
sc_finality_grandpa::GrandpaBlockImport<
49+
sc_consensus_grandpa::GrandpaBlockImport<
5050
FullBackend,
5151
Block,
5252
FullClient,
5353
FullSelectChain,
5454
>,
55-
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
55+
sc_consensus_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
5656
Option<Telemetry>,
5757
),
5858
>,
@@ -103,7 +103,7 @@ pub fn new_partial(
103103
client.clone(),
104104
);
105105

106-
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
106+
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
107107
client.clone(),
108108
&(client.clone() as Arc<_>),
109109
select_chain.clone(),
@@ -178,30 +178,30 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
178178
},
179179
};
180180
}
181-
let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name(
181+
let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name(
182182
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
183183
&config.chain_spec,
184184
);
185185

186186
config
187187
.network
188188
.extra_sets
189-
.push(sc_finality_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
190-
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
189+
.push(sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
190+
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
191191
backend.clone(),
192192
grandpa_link.shared_authority_set().clone(),
193193
Vec::default(),
194194
));
195195

196-
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
196+
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
197197
sc_service::build_network(sc_service::BuildNetworkParams {
198198
config: &config,
199199
client: client.clone(),
200200
transaction_pool: transaction_pool.clone(),
201201
spawn_handle: task_manager.spawn_handle(),
202202
import_queue,
203203
block_announce_validator_builder: None,
204-
warp_sync: Some(warp_sync),
204+
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync))
205205
})?;
206206

207207
if config.offchain_worker.enabled {
@@ -243,6 +243,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
243243
tx_handler_controller,
244244
config,
245245
telemetry: telemetry.as_mut(),
246+
sync_service: sync_service.clone()
246247
})?;
247248

248249
if role.is_authority() {
@@ -277,8 +278,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
277278
force_authoring,
278279
backoff_authoring_blocks,
279280
keystore: keystore_container.sync_keystore(),
280-
sync_oracle: network.clone(),
281-
justification_sync_link: network.clone(),
281+
sync_oracle: sync_service.clone(),
282+
justification_sync_link: sync_service.clone(),
282283
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
283284
max_block_proposal_slot_portion: None,
284285
telemetry: telemetry.as_ref().map(|x| x.handle()),
@@ -299,7 +300,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
299300
let keystore =
300301
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
301302

302-
let grandpa_config = sc_finality_grandpa::Config {
303+
let grandpa_config = sc_consensus_grandpa::Config {
303304
// FIXME #1578 make this available through chainspec
304305
gossip_duration: Duration::from_millis(333),
305306
justification_period: 512,
@@ -317,22 +318,23 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
317318
// and vote data availability than the observer. The observer has not
318319
// been tested extensively yet and having most nodes in a network run it
319320
// could lead to finality stalls.
320-
let grandpa_config = sc_finality_grandpa::GrandpaParams {
321+
let grandpa_config = sc_consensus_grandpa::GrandpaParams {
321322
config: grandpa_config,
322323
link: grandpa_link,
323324
network,
324-
voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
325+
sync: Arc::new(sync_service),
326+
voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(),
325327
prometheus_registry,
326328
shared_voter_state: SharedVoterState::empty(),
327-
telemetry: telemetry.as_ref().map(|x| x.handle()),
329+
telemetry: telemetry.as_ref().map(|x| x.handle())
328330
};
329331

330332
// the GRANDPA voter task is considered infallible, i.e.
331333
// if it fails we take down the service with it.
332334
task_manager.spawn_essential_handle().spawn_blocking(
333335
"grandpa-voter",
334336
None,
335-
sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
337+
sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?,
336338
);
337339
}
338340

pallets/dia-oracle/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ version = '3.0.0'
1818
default-features = false
1919
git = 'https://github.com/paritytech/substrate.git'
2020
optional = true
21-
branch = "polkadot-v0.9.37"
21+
branch = "polkadot-v0.9.40"
2222

2323
[dependencies.frame-support]
2424
default-features = false
2525
git = 'https://github.com/paritytech/substrate.git'
26-
branch = "polkadot-v0.9.37"
26+
branch = "polkadot-v0.9.40"
2727

2828
[dependencies.frame-system]
2929
default-features = false
3030
git = 'https://github.com/paritytech/substrate.git'
31-
branch = "polkadot-v0.9.37"
31+
branch = "polkadot-v0.9.40"
3232

3333
[dependencies.log]
3434
default-features = false
@@ -52,27 +52,27 @@ features = ['alloc']
5252
[dependencies.sp-core]
5353
default-features = false
5454
git = 'https://github.com/paritytech/substrate.git'
55-
branch = "polkadot-v0.9.37"
55+
branch = "polkadot-v0.9.40"
5656

5757
[dependencies.sp-std]
5858
default-features = false
5959
git = 'https://github.com/paritytech/substrate.git'
60-
branch = "polkadot-v0.9.37"
60+
branch = "polkadot-v0.9.40"
6161

6262
[dependencies.sp-runtime]
6363
default-features = false
6464
git = 'https://github.com/paritytech/substrate.git'
65-
branch = "polkadot-v0.9.37"
65+
branch = "polkadot-v0.9.40"
6666

6767
[dev-dependencies.sp-io]
6868
default-features = false
6969
git = 'https://github.com/paritytech/substrate.git'
70-
branch = "polkadot-v0.9.37"
70+
branch = "polkadot-v0.9.40"
7171

7272
[dev-dependencies.sp-runtime]
7373
default-features = false
7474
git = 'https://github.com/paritytech/substrate.git'
75-
branch = "polkadot-v0.9.37"
75+
branch = "polkadot-v0.9.40"
7676

7777

7878
[features]

pallets/dia-oracle/rpc/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ jsonrpsee = { version = "0.16.2", features = ["client-core", "server", "macros"]
1616
[dependencies.sp-api]
1717
default-features = false
1818
git = 'https://github.com/paritytech/substrate.git'
19-
branch = "polkadot-v0.9.37"
19+
branch = "polkadot-v0.9.40"
2020

2121
[dependencies.sp-blockchain]
2222
default-features = false
2323
git = 'https://github.com/paritytech/substrate.git'
24-
branch = "polkadot-v0.9.37"
24+
branch = "polkadot-v0.9.40"
2525

2626
[dependencies.sp-core]
2727
default-features = false
2828
git = 'https://github.com/paritytech/substrate.git'
29-
branch = "polkadot-v0.9.37"
29+
branch = "polkadot-v0.9.40"
3030

3131
[dependencies.sp-runtime]
3232
default-features = false
3333
git = 'https://github.com/paritytech/substrate.git'
34-
branch = "polkadot-v0.9.37"
34+
branch = "polkadot-v0.9.40"
3535

pallets/dia-oracle/rpc/runtime-api/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ dia-oracle = { version = "0.1.0", default-features = false, path = "../../../dia
1414
[dependencies.sp-api]
1515
default-features = false
1616
git = 'https://github.com/paritytech/substrate.git'
17-
branch = "polkadot-v0.9.37"
17+
branch = "polkadot-v0.9.40"
1818

1919
[dependencies.sp-runtime]
2020
default-features = false
2121
git = 'https://github.com/paritytech/substrate.git'
22-
branch = "polkadot-v0.9.37"
22+
branch = "polkadot-v0.9.40"
2323

2424
[dependencies.frame-support]
2525
default-features = false
2626
git = 'https://github.com/paritytech/substrate.git'
27-
branch = "polkadot-v0.9.37"
27+
branch = "polkadot-v0.9.40"
2828

2929

3030
[features]

pallets/dia-oracle/rpc/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use jsonrpsee::{
77
use sp_api::ProvideRuntimeApi;
88
use sp_blockchain::HeaderBackend;
99
use sp_core::Bytes;
10-
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
10+
use sp_runtime::traits::Block as BlockT;
1111

1212
pub use dia_oracle_runtime_api::DiaOracleApi as DiaOracleRuntimeApi;
1313

@@ -75,12 +75,12 @@ where
7575
at: Option<<Block as BlockT>::Hash>,
7676
) -> RpcResult<CoinInfo> {
7777
let api = self.client.runtime_api();
78-
let at = BlockId::hash(at.unwrap_or_else(||
78+
let at = at.unwrap_or_else(||
7979
// If the block hash is not supplied assume the best block.
80-
self.client.info().best_hash));
80+
self.client.info().best_hash);
8181

8282
let r = api
83-
.get_coin_info(&at, blockchain.to_vec(), symbol.to_vec())
83+
.get_coin_info(at, blockchain.to_vec(), symbol.to_vec())
8484
.map_err(|e| {
8585
CallError::Custom(ErrorObject::owned(
8686
Error::RuntimeError.into(),
@@ -106,12 +106,12 @@ where
106106
at: Option<<Block as BlockT>::Hash>,
107107
) -> RpcResult<PriceInfo> {
108108
let api = self.client.runtime_api();
109-
let at = BlockId::hash(at.unwrap_or_else(||
109+
let at = at.unwrap_or_else(||
110110
// If the block hash is not supplied assume the best block.
111-
self.client.info().best_hash));
111+
self.client.info().best_hash);
112112

113113
let r = api
114-
.get_value(&at, blockchain.to_vec(), symbol.to_vec())
114+
.get_value(at, blockchain.to_vec(), symbol.to_vec())
115115
.map_err(|e| {
116116
CallError::Custom(ErrorObject::owned(
117117
Error::RuntimeError.into(),

0 commit comments

Comments
 (0)