-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Features needed for reserve-backed stablecoins #7152
Changes from all commits
944c129
911795a
ddf83eb
9c79b6d
b8ef2fb
1888155
8bae97f
4df1054
aef1d0c
e302a0e
b173c37
6263beb
fd75591
3d03358
8aa7cc5
347f2db
2d5f752
760ba44
b630906
39a54ea
4d173bc
4664812
8954764
87f311e
d12fe90
e29b3fa
85443d2
b53c1ba
6de272f
27353a7
bbdce2e
0b5fa74
89cbf7e
1eff995
1fe69b1
76f2e40
a452393
402835d
373f4d7
d8b840a
13a0cc0
e65a75c
dc0839d
d0f1829
45f3c04
0286497
927bcc6
a1c43f9
82bbd66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -892,6 +892,22 @@ impl pallet_vesting::Config for Runtime { | |
type WeightInfo = pallet_vesting::weights::SubstrateWeight<Runtime>; | ||
} | ||
|
||
parameter_types! { | ||
pub const AssetDepositBase: Balance = 100 * DOLLARS; | ||
pub const AssetDepositPerZombie: Balance = 1 * DOLLARS; | ||
} | ||
|
||
impl pallet_assets::Config for Runtime { | ||
type Event = Event; | ||
type Balance = u64; | ||
type AssetId = u32; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: this should probably be a publicly defined type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One extra line for near zero gain. Sounds less like a nit-pick and more like a bikeshed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷 |
||
type Currency = Balances; | ||
type ForceOrigin = EnsureRoot<AccountId>; | ||
type AssetDepositBase = AssetDepositBase; | ||
type AssetDepositPerZombie = AssetDepositPerZombie; | ||
type WeightInfo = pallet_assets::weights::SubstrateWeight<Runtime>; | ||
} | ||
|
||
construct_runtime!( | ||
pub enum Runtime where | ||
Block = Block, | ||
|
@@ -929,6 +945,7 @@ construct_runtime!( | |
Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>}, | ||
Proxy: pallet_proxy::{Module, Call, Storage, Event<T>}, | ||
Multisig: pallet_multisig::{Module, Call, Storage, Event<T>}, | ||
Assets: pallet_assets::{Module, Call, Storage, Event<T>}, | ||
} | ||
); | ||
|
||
|
@@ -1195,6 +1212,7 @@ impl_runtime_apis! { | |
let mut batches = Vec::<BenchmarkBatch>::new(); | ||
let params = (&config, &whitelist); | ||
|
||
add_benchmark!(params, batches, pallet_assets, Assets); | ||
add_benchmark!(params, batches, pallet_babe, Babe); | ||
add_benchmark!(params, batches, pallet_balances, Balances); | ||
add_benchmark!(params, batches, pallet_collective, Council); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incompatible with the standard
type Balance = u128
defined in the standard Substrate node and node-template. This should use theBalance
type to be compatible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u128
is not a "standard" and there is no reason to think that fungible asset pallet balances should necessarily be the same type as a balance elsewhere in the chain.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmh, I guess I would expect a runtime to follow the convention of only having one type named
Balance
to avoid confusion. I see your point that they can be different in principle, though.maybe standard was the wrong word, I meant standard as in "default" or "configured" or "example"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JesseAbram and I tried setting a Substrate chain up with
u64
as the assetsBalance
type, but polkadot-js assumes thatT::Balance
equalsBalance
(the globally defined type), so in practice we are not able to interact with the chain. (This is a similar issue to the other issue you already addressed.)We'll get in touch with Jaco about improving polkadot-js on this, but until then we need to configure it to be the same concrete type or change the name.
Edit: never mind, we found the
typesAlias
stuff.