Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
7071a022
Unverified
Commit
7071a022
authored
Jul 17, 2020
by
Shawn Tabrizi
Committed by
GitHub
Jul 17, 2020
Browse files
Add purchase module to westend (#1429)
parent
5b27dd39
Pipeline
#100852
passed with stages
in 29 minutes and 56 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
runtime/westend/Cargo.toml
View file @
7071a022
...
...
@@ -70,7 +70,7 @@ frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch =
frame-system-benchmarking
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
,
default-features
=
false
,
optional
=
true
}
pallet-offences-benchmarking
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
,
default-features
=
false
,
optional
=
true
}
pallet-session-benchmarking
=
{
git
=
"https://github.com/paritytech/substrate"
,
branch
=
"master"
,
default-features
=
false
,
optional
=
true
}
hex-literal
=
{
version
=
"0.2.1"
,
optional
=
true
}
hex-literal
=
{
version
=
"0.2.1"
}
runtime-common
=
{
package
=
"polkadot-runtime-common"
,
path
=
"../common"
,
default-features
=
false
}
primitives
=
{
package
=
"polkadot-primitives"
,
path
=
"../../primitives"
,
default-features
=
false
}
...
...
@@ -172,7 +172,8 @@ runtime-benchmarks = [
"vesting/runtime-benchmarks"
,
"pallet-offences-benchmarking"
,
"pallet-session-benchmarking"
,
"hex-literal"
,
# uncomment when it is made optional again
# "hex-literal",
]
# When enabled, the runtime api will not be build.
#
...
...
runtime/westend/src/lib.rs
View file @
7071a022
...
...
@@ -28,14 +28,14 @@ use primitives::v0::{
ActiveParas
,
AbridgedCandidateReceipt
,
SigningContext
,
};
use
runtime_common
::{
attestations
,
parachains
,
registrar
,
SlowAdjustingFeeUpdate
,
attestations
,
parachains
,
registrar
,
purchase
,
SlowAdjustingFeeUpdate
,
impls
::{
CurrencyToVoteHandler
,
ToAuthor
},
BlockHashCount
,
MaximumBlockWeight
,
AvailableBlockRatio
,
MaximumBlockLength
,
BlockExecutionWeight
,
ExtrinsicBaseWeight
,
RocksDbWeight
,
MaximumExtrinsicWeight
,
};
use
sp_runtime
::{
create_runtime_str
,
generic
,
impl_opaque_keys
,
ApplyExtrinsicResult
,
KeyTypeId
,
Perbill
,
curve
::
PiecewiseLinear
,
ApplyExtrinsicResult
,
KeyTypeId
,
Permill
,
Perbill
,
curve
::
PiecewiseLinear
,
transaction_validity
::{
TransactionValidity
,
TransactionSource
,
TransactionPriority
},
traits
::{
BlakeTwo256
,
Block
as
BlockT
,
OpaqueKeys
,
ConvertInto
,
IdentityLookup
,
...
...
@@ -51,7 +51,7 @@ use version::NativeVersion;
use
sp_core
::
OpaqueMetadata
;
use
sp_staking
::
SessionIndex
;
use
frame_support
::{
parameter_types
,
construct_runtime
,
debug
,
RuntimeDebug
,
parameter_types
,
ord_parameter_types
,
construct_runtime
,
debug
,
RuntimeDebug
,
traits
::{
KeyOwnerProofSystem
,
Randomness
,
Filter
,
InstanceFilter
},
weights
::
Weight
,
};
...
...
@@ -59,7 +59,7 @@ use im_online::sr25519::AuthorityId as ImOnlineId;
use
authority_discovery_primitives
::
AuthorityId
as
AuthorityDiscoveryId
;
use
transaction_payment_rpc_runtime_api
::
RuntimeDispatchInfo
;
use
session
::
historical
as
session_historical
;
use
system
::
EnsureRoot
;
use
system
::
{
EnsureRoot
,
EnsureSignedBy
,
EnsureOneOf
}
;
#[cfg(feature
=
"std"
)]
pub
use
staking
::
StakerStatus
;
...
...
@@ -690,6 +690,46 @@ impl proxy::Trait for Runtime {
type
WeightInfo
=
();
}
parameter_types!
{
pub
const
MaxStatementLength
:
usize
=
1_000
;
pub
const
UnlockedProportion
:
Permill
=
Permill
::
zero
();
pub
const
MaxUnlocked
:
Balance
=
0
;
}
ord_parameter_types!
{
pub
const
PurchaseValidity
:
AccountId
=
AccountId
::
from
(
// 5CqSB6zNHcp3mvTAyh5Vr2MbSdb7DgLi9yWoAppHRveGcYQh
hex_literal
::
hex!
(
"221d409ba60508368d4448ccda40182aca2744bcdfa0881944c08108a9fd966d"
)
);
pub
const
PurchaseConfiguration
:
AccountId
=
AccountId
::
from
(
// 5FUP4BwQzi8F5WBTmaHsoobGbMSUTiX7Exwb7QzTjgNQypo1
hex_literal
::
hex!
(
"96c34c8c60b3690701176bdbc9b16aced2898d754385a84ee0cfe7fb015db800"
)
);
}
type
ValidityOrigin
=
EnsureOneOf
<
AccountId
,
EnsureRoot
<
AccountId
>
,
EnsureSignedBy
<
PurchaseValidity
,
AccountId
>
,
>
;
type
ConfigurationOrigin
=
EnsureOneOf
<
AccountId
,
EnsureRoot
<
AccountId
>
,
EnsureSignedBy
<
PurchaseConfiguration
,
AccountId
>
,
>
;
impl
purchase
::
Trait
for
Runtime
{
type
Event
=
Event
;
type
Currency
=
Balances
;
type
VestingSchedule
=
Vesting
;
type
ValidityOrigin
=
ValidityOrigin
;
type
ConfigurationOrigin
=
ConfigurationOrigin
;
type
MaxStatementLength
=
MaxStatementLength
;
type
UnlockedProportion
=
UnlockedProportion
;
type
MaxUnlocked
=
MaxUnlocked
;
}
construct_runtime!
{
pub
enum
Runtime
where
Block
=
Block
,
...
...
@@ -748,6 +788,9 @@ construct_runtime! {
// Multisig module. Late addition.
Multisig
:
multisig
::{
Module
,
Call
,
Storage
,
Event
<
T
>
},
// Purchase module. Late addition.
Purchase
:
purchase
::{
Module
,
Call
,
Storage
,
Event
<
T
>
},
}
}
...
...
Ghost User
@ghost
mentioned in commit
eda599cd
·
Jul 17, 2020
mentioned in commit
eda599cd
mentioned in commit eda599cd07470dfab804e2d382ba476995823192
Toggle commit list
Ghost User
@ghost
mentioned in commit
9203a84a
·
Jul 17, 2020
mentioned in commit
9203a84a
mentioned in commit 9203a84aa0bd75b0e3a7d1a38b2b6b8c35c4c5d3
Toggle commit list
Ghost User
@ghost
mentioned in commit
c8f30e04
·
Jul 17, 2020
mentioned in commit
c8f30e04
mentioned in commit c8f30e04846504688c3905a6ec692993eaf339d2
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment