mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
log max balance drop when sending message (#1117)
This commit is contained in:
committed by
Bastian Köcher
parent
3d4d66456d
commit
d59d442e93
@@ -177,6 +177,18 @@ impl SendMessage {
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
let source_genesis_hash = *source_client.genesis_hash();
|
let source_genesis_hash = *source_client.genesis_hash();
|
||||||
|
let estimated_transaction_fee = source_client
|
||||||
|
.estimate_extrinsic_fee(Bytes(
|
||||||
|
Source::sign_transaction(
|
||||||
|
source_genesis_hash,
|
||||||
|
&source_sign,
|
||||||
|
relay_substrate_client::TransactionEra::immortal(),
|
||||||
|
0,
|
||||||
|
send_message_call.clone(),
|
||||||
|
)
|
||||||
|
.encode(),
|
||||||
|
))
|
||||||
|
.await?;
|
||||||
source_client
|
source_client
|
||||||
.submit_signed_extrinsic(source_sign.public().into(), move |_, transaction_nonce| {
|
.submit_signed_extrinsic(source_sign.public().into(), move |_, transaction_nonce| {
|
||||||
let signed_source_call = Source::sign_transaction(
|
let signed_source_call = Source::sign_transaction(
|
||||||
@@ -197,6 +209,15 @@ impl SendMessage {
|
|||||||
dispatch_weight,
|
dispatch_weight,
|
||||||
fee,
|
fee,
|
||||||
);
|
);
|
||||||
|
log::info!(
|
||||||
|
target: "bridge",
|
||||||
|
"The source account ({:?}) balance will be reduced by (at most) {} (message fee) + {} (tx fee ) = {} {} tokens",
|
||||||
|
AccountId32::from(source_sign.public()),
|
||||||
|
fee.0,
|
||||||
|
estimated_transaction_fee.inclusion_fee(),
|
||||||
|
fee.0.saturating_add(estimated_transaction_fee.inclusion_fee() as _),
|
||||||
|
Source::NAME,
|
||||||
|
);
|
||||||
log::info!(
|
log::info!(
|
||||||
target: "bridge",
|
target: "bridge",
|
||||||
"Signed {} Call: {:?}",
|
"Signed {} Call: {:?}",
|
||||||
|
|||||||
Reference in New Issue
Block a user