Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu committed Feb 14, 2023
1 parent 2facff4 commit aebb262
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions runtime/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,37 @@ impl InterBtcParachain {
Ok(())
}

#[cfg(test)]
pub async fn register_markets(&self) -> Result<(), Error> {
let metadatas = GenericAssetMetadata {
decimals: 10,
location: None,
name: b"Tether USD".to_vec(),
symbol: "USDT".as_bytes().to_vec(),
existential_deposit: 0,
additional: metadata::runtime_types::interbtc_primitives::CustomMetadata {
fee_per_second: 0,
coingecko_id: vec![],
},
};

let registration_calls = metadatas
.map(|metadata| {
EncodedCall::Loans(
metadata::runtime_types::loans::pallet::Call::add_market { asset_id: (), market: () }
)
})
.to_vec();

let batch = EncodedCall::Utility(metadata::runtime_types::pallet_utility::pallet::Call::batch {
calls: registration_calls,
});

self.with_unique_signer(metadata::tx().sudo().sudo(batch)).await?;
Ok(())
}


pub async fn store_assets_metadata(&self) -> Result<(), Error> {
AssetRegistry::extend(self.get_foreign_assets_metadata().await?)
}
Expand Down

0 comments on commit aebb262

Please sign in to comment.