Skip to content

Commit

Permalink
add tdot
Browse files Browse the repository at this point in the history
  • Loading branch information
mn13 committed Oct 19, 2023
1 parent ab123b8 commit 78a0c29
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions eq-primitives/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ pub const PHA: Asset = Asset(7366753); //::from_bytes(b"pha"); 0x706861
pub const VDOT: Asset = Asset(1986293620); //::from_bytes(b"vdot"); 0x76646F74
pub const LDOT: Asset = Asset(1818521460); //::from_bytes(b"ldot"); 0x6C646F74
pub const SDOT: Asset = Asset(1935961972); //::from_bytes(b"sdot"); 0x73646F74
pub const TDOT: Asset = Asset(1952739188); //::from_bytes(b"tdot"); 0x74646f74

// Kusama relay-chain
pub const KSM: Asset = Asset(7041901); //::from_bytes(b"ksm"); 0x6B736D
Expand Down
13 changes: 12 additions & 1 deletion pallets/eq-oracle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ impl<T: Config> Pallet<T> {
);
}

// TODO remove after YIELD !!!
if T::AssetGetter::exists(asset::XDOT) {
signer.send_unsigned_transaction(
|account| PricePayload {
Expand Down Expand Up @@ -1030,6 +1029,18 @@ impl<T: Config> Pallet<T> {
);
}
}

if T::AssetGetter::exists(asset::TDOT) {
signer.send_unsigned_transaction(
|account| PricePayload {
public: account.public.clone(),
asset: asset::TDOT,
price: price,
block_number,
},
|payload, signature| Call::set_price_unsigned { payload, signature },
);
}
}

signer.send_unsigned_transaction(
Expand Down
8 changes: 8 additions & 0 deletions pallets/eq-oracle/src/price_source/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ impl PriceSource for JsonPriceSource {
continue;
}

if asset == eq_primitives::asset::STDOT {
continue;
}

if asset == eq_primitives::asset::TDOT {
continue;
}

// If specified, do not fetch non available currencies
let price = if let Some(asset_settings) = &maybe_asset_settings {
if asset_settings.len() == 0 {
Expand Down

0 comments on commit 78a0c29

Please sign in to comment.