Skip to content

Commit

Permalink
shield-xfer-unshield works for USDC.e
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Feb 11, 2025
1 parent 3570ed5 commit 1772a40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app-libs/stf/src/trusted_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,9 @@ where
fee,
shard
);
let location = asset_id
.into_location()
.ok_or(StfError::Dispatch("unknown asset id location".into()))?;
burn_assets(&account_incognito, value, asset_id)?;
store_note(
&account_incognito,
Expand All @@ -636,8 +639,8 @@ where
.get_from_metadata(|m| m.foreign_assets_transfer_keep_alive_call_indexes())
.map_err(|_| StfError::InvalidMetadata)?
.map_err(|_| StfError::InvalidMetadata)?,
asset_id.into_location(),
Address::from(beneficiary),
location,
Address::Id(beneficiary),
Compact(value),
));
let call = OpaqueCall::from_tuple(&(
Expand Down
2 changes: 1 addition & 1 deletion cli/src/assets/commands/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl BalanceCommand {
None,
)
.unwrap()
.unwrap();
.unwrap_or_default();
info!("{:?}", asset_account);
println!("{}", asset_account.balance);
Ok(CliResultOk::Balance { balance: asset_account.balance })
Expand Down
6 changes: 6 additions & 0 deletions core-primitives/types/src/parentchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ pub struct AssetAccount {
pub extra: (),
}

impl Default for AssetAccount {
fn default() -> Self {
Self { balance: 0, is_frozen: false, reason: ExistenceReason::Consumer, extra: () }
}
}

#[derive(Encode, Decode, Copy, Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum ParentchainId {
Expand Down

0 comments on commit 1772a40

Please sign in to comment.