extend event during bridging with exodus_session for UI only
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
parent
f526774201
commit
5e4267fdde
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -1195,7 +1195,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "casper-runtime"
|
name = "casper-runtime"
|
||||||
version = "4.0.21"
|
version = "4.0.25"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"casper-runtime-constants",
|
"casper-runtime-constants",
|
||||||
"frame-benchmarking",
|
"frame-benchmarking",
|
||||||
@ -3685,7 +3685,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ghost-exodus"
|
name = "ghost-exodus"
|
||||||
version = "0.1.7"
|
version = "0.1.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
"frame-benchmarking",
|
"frame-benchmarking",
|
||||||
@ -4090,7 +4090,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ghost-traits"
|
name = "ghost-traits"
|
||||||
version = "0.4.10"
|
version = "0.4.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"frame-support",
|
"frame-support",
|
||||||
"frost-core",
|
"frost-core",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ghost-exodus"
|
name = "ghost-exodus"
|
||||||
version = "0.1.10"
|
version = "0.1.11"
|
||||||
description = "Threshold signature generation with DKG included"
|
description = "Threshold signature generation with DKG included"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|||||||
@ -455,6 +455,7 @@ pub mod pallet {
|
|||||||
amount: BalanceOf<T>,
|
amount: BalanceOf<T>,
|
||||||
bounty: Perbill,
|
bounty: Perbill,
|
||||||
receiver: EvmAddress,
|
receiver: EvmAddress,
|
||||||
|
exodus_session: ExodusSession,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1798,7 +1799,7 @@ pub mod pallet {
|
|||||||
Fortitude::Polite,
|
Fortitude::Polite,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Self::do_register_evm_bridge_out_exodus(
|
let exodus_session = Self::do_register_evm_bridge_out_exodus(
|
||||||
network_id,
|
network_id,
|
||||||
actual_amount,
|
actual_amount,
|
||||||
bounty,
|
bounty,
|
||||||
@ -1811,6 +1812,7 @@ pub mod pallet {
|
|||||||
amount: actual_amount,
|
amount: actual_amount,
|
||||||
bounty,
|
bounty,
|
||||||
receiver,
|
receiver,
|
||||||
|
exodus_session,
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -2084,7 +2086,7 @@ impl<T: Config> Pallet<T> {
|
|||||||
fn do_register_evm_exodus(
|
fn do_register_evm_exodus(
|
||||||
network_id: NetworkIdOf<T>,
|
network_id: NetworkIdOf<T>,
|
||||||
exodus_request: ExodusRequest<T>,
|
exodus_request: ExodusRequest<T>,
|
||||||
) -> DispatchResult {
|
) -> Result<ExodusSession, DispatchError> {
|
||||||
let network = T::NetworkDataHandler::get(&network_id)
|
let network = T::NetworkDataHandler::get(&network_id)
|
||||||
.ok_or(Error::<T>::NetworkDoesNotExist)?;
|
.ok_or(Error::<T>::NetworkDoesNotExist)?;
|
||||||
|
|
||||||
@ -2100,7 +2102,7 @@ impl<T: Config> Pallet<T> {
|
|||||||
|
|
||||||
ExodusRequests::<T>::insert((&network.curve, &exodus_context), exodus_request);
|
ExodusRequests::<T>::insert((&network.curve, &exodus_context), exodus_request);
|
||||||
|
|
||||||
Ok(())
|
Ok(exodus_session)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_register_evm_bridge_out_exodus(
|
fn do_register_evm_bridge_out_exodus(
|
||||||
@ -2108,7 +2110,7 @@ impl<T: Config> Pallet<T> {
|
|||||||
amount: BalanceOf<T>,
|
amount: BalanceOf<T>,
|
||||||
bounty: Perbill,
|
bounty: Perbill,
|
||||||
receiver: EvmAddress,
|
receiver: EvmAddress,
|
||||||
) -> DispatchResult {
|
) -> Result<ExodusSession, DispatchError> {
|
||||||
let out_amount =
|
let out_amount =
|
||||||
T::NetworkDataHandler::register_outgoing(&network_id, amount)
|
T::NetworkDataHandler::register_outgoing(&network_id, amount)
|
||||||
.map_err(|_| Error::<T>::BridgeOverflow)?;
|
.map_err(|_| Error::<T>::BridgeOverflow)?;
|
||||||
@ -2122,7 +2124,7 @@ impl<T: Config> Pallet<T> {
|
|||||||
network_id: NetworkIdOf<T>,
|
network_id: NetworkIdOf<T>,
|
||||||
target_address: EvmAddress,
|
target_address: EvmAddress,
|
||||||
governance_action: GovernanceAction,
|
governance_action: GovernanceAction,
|
||||||
) -> DispatchResult {
|
) -> Result<ExodusSession, DispatchError> {
|
||||||
let evm_governance_request =
|
let evm_governance_request =
|
||||||
ExodusRequest::evm_governance(target_address, governance_action);
|
ExodusRequest::evm_governance(target_address, governance_action);
|
||||||
|
|
||||||
@ -5399,12 +5401,17 @@ impl<T: Config> EvmGovernanceRegistrar<NetworkIdOf<T>, EvmAddress, GovernanceAct
|
|||||||
network_id: NetworkIdOf<T>,
|
network_id: NetworkIdOf<T>,
|
||||||
target_address: EvmAddress,
|
target_address: EvmAddress,
|
||||||
governance_action: GovernanceAction,
|
governance_action: GovernanceAction,
|
||||||
) -> DispatchResult {
|
) -> Result<u128, DispatchError> {
|
||||||
Self::do_register_evm_governance(
|
let exodus_session = Self::do_register_evm_governance(
|
||||||
network_id,
|
network_id,
|
||||||
target_address,
|
target_address,
|
||||||
governance_action,
|
governance_action,
|
||||||
)
|
)?;
|
||||||
|
|
||||||
|
let exodus_session_u128: u128 = exodus_session
|
||||||
|
.unique_saturated_into();
|
||||||
|
|
||||||
|
Ok(exodus_session_u128)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1433,6 +1433,7 @@ fn register_evm_bridge_out_dynamic_threshold_works() {
|
|||||||
amount: amount_1,
|
amount: amount_1,
|
||||||
bounty,
|
bounty,
|
||||||
receiver,
|
receiver,
|
||||||
|
exodus_session: 0,
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ghost-traits"
|
name = "ghost-traits"
|
||||||
version = "0.4.10"
|
version = "0.4.11"
|
||||||
description = "Shared traits including `GhostHasher`, `NetworkDataBasicHandler`, `BoundedBTreeMap`, `MerkleTree` and more."
|
description = "Shared traits including `GhostHasher`, `NetworkDataBasicHandler`, `BoundedBTreeMap`, `MerkleTree` and more."
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|||||||
@ -128,5 +128,5 @@ pub trait EvmGovernanceRegistrar<NetworkId, EvmAddress, GovernanceAction> {
|
|||||||
network_id: NetworkId,
|
network_id: NetworkId,
|
||||||
target_address: EvmAddress,
|
target_address: EvmAddress,
|
||||||
governance_action: GovernanceAction
|
governance_action: GovernanceAction
|
||||||
) -> frame_support::dispatch::DispatchResult;
|
) -> Result<u128, frame_support::pallet_prelude::DispatchError>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "casper-runtime"
|
name = "casper-runtime"
|
||||||
version = "4.0.24"
|
version = "4.0.25"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
description = "Runtime of the Casper Network"
|
description = "Runtime of the Casper Network"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("casper"),
|
spec_name: create_runtime_str!("casper"),
|
||||||
impl_name: create_runtime_str!("casper-svengali"),
|
impl_name: create_runtime_str!("casper-svengali"),
|
||||||
authoring_version: 0,
|
authoring_version: 0,
|
||||||
spec_version: 18,
|
spec_version: 19,
|
||||||
impl_version: 0,
|
impl_version: 0,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 1,
|
transaction_version: 1,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user