Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Reward relayer on AH for E->S transfer #165

Closed
wants to merge 1 commit into from
Closed

Conversation

yrong
Copy link

@yrong yrong commented Jul 29, 2024

No description provided.

@yrong yrong changed the title Reward relayer on AH Reward relayer on AH for E->P transfer Jul 30, 2024
@yrong yrong changed the title Reward relayer on AH for E->P transfer Reward relayer on AH for E->S transfer Jul 30, 2024
Comment on lines -266 to -279
// Reward relayer from the sovereign account of the destination parachain, only if funds
// are available
let sovereign_account = sibling_sovereign_account::<T>(channel.para_id);
let delivery_cost = Self::calculate_delivery_cost(message.encode().len() as u32);
let amount = T::Token::reducible_balance(
&sovereign_account,
Preservation::Preserve,
Fortitude::Polite,
)
.min(delivery_cost);
if !amount.is_zero() {
T::Token::transfer(&sovereign_account, &who, amount, Preservation::Preserve)?;
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the reward logic here, instead to reward relayer on AH with the fee token transfered from Ethereum.

Comment on lines +280 to +287
// Burning fees from the relay for teleport
T::Token::burn_from(
&who,
fee,
Preservation::Preserve,
Precision::BestEffort,
Fortitude::Polite,
)?;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Burn fees from relayer instead of the Parachain sovereign.

Comment on lines +277 to +282
// No matter what error it is just try to Deposit the asset to beneficiary without
// trapped.
SetErrorHandler(Xcm(vec![DepositAsset {
assets: Definite(asset.clone().into()),
beneficiary: beneficiary.clone(),
}])),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an extra SetErrorHandle try to Deposit the asset to beneficiary in any case.

@yrong yrong closed this Aug 22, 2024
@yrong yrong added the xcm label Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant