Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 18c72d3

Browse files
committed
Merge remote-tracking branch 'origin/master' into gav-gov2-tweaks
2 parents fd5e03a + c865344 commit 18c72d3

File tree

186 files changed

+5670
-3247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+5670
-3247
lines changed

.github/allowed-actions.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/check-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
check-labels:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
1414
ref: ${{ github.event.pull_request.head.ref }}

.github/workflows/md-link-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
markdown-link-check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: gaurav-nelson/github-action-markdown-link-check@7481451f70251762f149d69596e3e276ebf2b236
15+
- uses: actions/checkout@v3
16+
- uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976 # v1.0.13
1717
with:
1818
use-quiet-mode: 'yes'
1919
config-file: '.github/workflows/mlc_config.json'

.github/workflows/monthly-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
echo "::set-output name=new::$(date +'monthly-%Y-%m')"
1717
echo "::set-output name=old::$(date -d'1 month ago' +'monthly-%Y-%m')"
1818
- name: Checkout branch "master"
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
with:
2121
ref: 'master'
2222
fetch-depth: 0

.github/workflows/pr-custom-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
if: github.event.pull_request.draft == true
3838
run: exit 1
3939
- name: pr-custom-review
40-
uses: paritytech/pr-custom-review@v2
40+
uses: paritytech/pr-custom-review@action-v3
4141
with:
42-
token: ${{ secrets.PRCR_TOKEN }}
42+
checks-reviews-api: http://pcr.parity-prod.parity.io/api/v1/check_reviews

Cargo.lock

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

bin/node-template/node/src/rpc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ where
3939
C::Api: BlockBuilder<Block>,
4040
P: TransactionPool + 'static,
4141
{
42-
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
43-
use substrate_frame_rpc_system::{SystemApiServer, SystemRpc};
42+
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
43+
use substrate_frame_rpc_system::{System, SystemApiServer};
4444

4545
let mut module = RpcModule::new(());
4646
let FullDeps { client, pool, deny_unsafe } = deps;
4747

48-
module.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
49-
module.merge(TransactionPaymentRpc::new(client).into_rpc())?;
48+
module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
49+
module.merge(TransactionPayment::new(client).into_rpc())?;
5050

5151
// Extend this RPC with a custom API by using the following syntax.
5252
// `YourRpcStruct` should have a reference to a client, which is needed

bin/node/executor/tests/fees.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
use codec::{Encode, Joiner};
1919
use frame_support::{
2020
traits::Currency,
21-
weights::{
22-
constants::ExtrinsicBaseWeight, GetDispatchInfo, IdentityFee, WeightToFeePolynomial,
23-
},
21+
weights::{constants::ExtrinsicBaseWeight, GetDispatchInfo, IdentityFee, WeightToFee},
2422
};
2523
use node_primitives::Balance;
2624
use node_runtime::{
@@ -197,13 +195,13 @@ fn transaction_fee_is_correct() {
197195
let mut balance_alice = (100 - 69) * DOLLARS;
198196

199197
let base_weight = ExtrinsicBaseWeight::get();
200-
let base_fee = IdentityFee::<Balance>::calc(&base_weight);
198+
let base_fee = IdentityFee::<Balance>::weight_to_fee(&base_weight);
201199

202200
let length_fee = TransactionByteFee::get() * (xt.clone().encode().len() as Balance);
203201
balance_alice -= length_fee;
204202

205203
let weight = default_transfer_call().get_dispatch_info().weight;
206-
let weight_fee = IdentityFee::<Balance>::calc(&weight);
204+
let weight_fee = IdentityFee::<Balance>::weight_to_fee(&weight);
207205

208206
// we know that weight to fee multiplier is effect-less in block 1.
209207
// current weight of transfer = 200_000_000

bin/node/rpc/src/lib.rs

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ use jsonrpsee::RpcModule;
3737
use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index};
3838
use sc_client_api::AuxStore;
3939
use sc_consensus_babe::{Config, Epoch};
40-
use sc_consensus_babe_rpc::BabeRpc;
4140
use sc_consensus_epochs::SharedEpochChanges;
4241
use sc_finality_grandpa::{
4342
FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,
4443
};
45-
use sc_finality_grandpa_rpc::GrandpaRpc;
4644
use sc_rpc::SubscriptionTaskExecutor;
4745
pub use sc_rpc_api::DenyUnsafe;
4846
use sc_transaction_pool_api::TransactionPool;
@@ -120,15 +118,15 @@ where
120118
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
121119
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
122120
{
123-
use pallet_contracts_rpc::{ContractsApiServer, ContractsRpc};
124-
use pallet_mmr_rpc::{MmrApiServer, MmrRpc};
125-
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
126-
use sc_consensus_babe_rpc::BabeApiServer;
127-
use sc_finality_grandpa_rpc::GrandpaApiServer;
121+
use pallet_contracts_rpc::{Contracts, ContractsApiServer};
122+
use pallet_mmr_rpc::{Mmr, MmrApiServer};
123+
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
124+
use sc_consensus_babe_rpc::{Babe, BabeApiServer};
125+
use sc_finality_grandpa_rpc::{Grandpa, GrandpaApiServer};
128126
use sc_rpc::dev::{Dev, DevApiServer};
129-
use sc_sync_state_rpc::{SyncStateRpc, SyncStateRpcApiServer};
130-
use substrate_frame_rpc_system::{SystemApiServer, SystemRpc};
131-
use substrate_state_trie_migration_rpc::StateMigrationApiServer;
127+
use sc_sync_state_rpc::{SyncState, SyncStateApiServer};
128+
use substrate_frame_rpc_system::{System, SystemApiServer};
129+
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};
132130

133131
let mut io = RpcModule::new(());
134132
let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa } = deps;
@@ -142,15 +140,15 @@ where
142140
finality_provider,
143141
} = grandpa;
144142

145-
io.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?;
143+
io.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
146144
// Making synchronous calls in light client freezes the browser currently,
147145
// more context: https://github.com/paritytech/substrate/pull/3480
148146
// These RPCs should use an asynchronous caller instead.
149-
io.merge(ContractsRpc::new(client.clone()).into_rpc())?;
150-
io.merge(MmrRpc::new(client.clone()).into_rpc())?;
151-
io.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
147+
io.merge(Contracts::new(client.clone()).into_rpc())?;
148+
io.merge(Mmr::new(client.clone()).into_rpc())?;
149+
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
152150
io.merge(
153-
BabeRpc::new(
151+
Babe::new(
154152
client.clone(),
155153
shared_epoch_changes.clone(),
156154
keystore,
@@ -161,7 +159,7 @@ where
161159
.into_rpc(),
162160
)?;
163161
io.merge(
164-
GrandpaRpc::new(
162+
Grandpa::new(
165163
subscription_executor,
166164
shared_authority_set.clone(),
167165
shared_voter_state,
@@ -172,14 +170,11 @@ where
172170
)?;
173171

174172
io.merge(
175-
SyncStateRpc::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)?
173+
SyncState::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)?
176174
.into_rpc(),
177175
)?;
178176

179-
io.merge(
180-
substrate_state_trie_migration_rpc::MigrationRpc::new(client.clone(), backend, deny_unsafe)
181-
.into_rpc(),
182-
)?;
177+
io.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
183178
io.merge(Dev::new(client, deny_unsafe).into_rpc())?;
184179

185180
Ok(io)

bin/node/runtime/src/impls.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mod multiplier_tests {
5959
AdjustmentVariable, MinimumMultiplier, Runtime, RuntimeBlockWeights as BlockWeights,
6060
System, TargetBlockFullness, TransactionPayment,
6161
};
62-
use frame_support::weights::{DispatchClass, Weight, WeightToFeePolynomial};
62+
use frame_support::weights::{DispatchClass, Weight, WeightToFee};
6363

6464
fn max_normal() -> Weight {
6565
BlockWeights::get()
@@ -234,7 +234,9 @@ mod multiplier_tests {
234234
fm = next;
235235
iterations += 1;
236236
let fee =
237-
<Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(&tx_weight);
237+
<Runtime as pallet_transaction_payment::Config>::WeightToFee::weight_to_fee(
238+
&tx_weight,
239+
);
238240
let adjusted_fee = fm.saturating_mul_acc_int(fee);
239241
println!(
240242
"iteration {}, new fm = {:?}. Fee at this point is: {} units / {} millicents, \

0 commit comments

Comments
 (0)