mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 02:21:14 +00:00
Client::info() no longer returns a Result (#2776)
This commit is contained in:
committed by
Bastian Köcher
parent
53e8ad8728
commit
5df89a8a6f
@@ -23,14 +23,14 @@ fn sr_api_benchmark(c: &mut Criterion) {
|
||||
c.bench_function("add one with same runtime api", |b| {
|
||||
let client = test_client::new();
|
||||
let runtime_api = client.runtime_api();
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
|
||||
b.iter(|| runtime_api.benchmark_add_one(&block_id, &1))
|
||||
});
|
||||
|
||||
c.bench_function("add one with recreating runtime api", |b| {
|
||||
let client = test_client::new();
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
|
||||
b.iter(|| client.runtime_api().benchmark_add_one(&block_id, &1))
|
||||
});
|
||||
@@ -38,7 +38,7 @@ fn sr_api_benchmark(c: &mut Criterion) {
|
||||
c.bench_function("vector add one with same runtime api", |b| {
|
||||
let client = test_client::new();
|
||||
let runtime_api = client.runtime_api();
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
let data = vec![0; 1000];
|
||||
|
||||
b.iter_with_large_drop(|| runtime_api.benchmark_vector_add_one(&block_id, &data))
|
||||
@@ -46,7 +46,7 @@ fn sr_api_benchmark(c: &mut Criterion) {
|
||||
|
||||
c.bench_function("vector add one with recreating runtime api", |b| {
|
||||
let client = test_client::new();
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
let data = vec![0; 1000];
|
||||
|
||||
b.iter_with_large_drop(|| client.runtime_api().benchmark_vector_add_one(&block_id, &data))
|
||||
@@ -54,13 +54,13 @@ fn sr_api_benchmark(c: &mut Criterion) {
|
||||
|
||||
c.bench_function("calling function by function pointer in wasm", |b| {
|
||||
let client = test_client::new_with_execution_strategy(ExecutionStrategy::AlwaysWasm);
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
b.iter(|| client.runtime_api().benchmark_indirect_call(&block_id).unwrap())
|
||||
});
|
||||
|
||||
c.bench_function("calling function in wasm", |b| {
|
||||
let client = test_client::new_with_execution_strategy(ExecutionStrategy::AlwaysWasm);
|
||||
let block_id = BlockId::Number(client.info().unwrap().chain.best_number);
|
||||
let block_id = BlockId::Number(client.info().chain.best_number);
|
||||
b.iter(|| client.runtime_api().benchmark_direct_call(&block_id).unwrap())
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user