-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: keep utxos even if swallowed (PRO-1068) (#4360) * fix: network fee (#4364) Co-authored-by: Daniel <daniel@chainflip.io> * feat: more accurate btc fees (#4367) * fix test --------- Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com> Co-authored-by: Alastair Holmes <42404303+AlastairHolmes@users.noreply.github.com> Co-authored-by: Daniel <daniel@chainflip.io>
- Loading branch information
1 parent
da30422
commit 25e3d89
Showing
8 changed files
with
166 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
pub mod v1; | ||
pub mod v2; | ||
|
||
use cf_runtime_upgrade_utilities::VersionedMigration; | ||
|
||
pub type PalletMigration<T> = (VersionedMigration<crate::Pallet<T>, v1::Migration<T>, 0, 1>,); | ||
pub type PalletMigration<T> = ( | ||
VersionedMigration<crate::Pallet<T>, v1::Migration<T>, 0, 1>, | ||
VersionedMigration<crate::Pallet<T>, v2::Migration<T>, 1, 2>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::*; | ||
use frame_support::traits::OnRuntimeUpgrade; | ||
use sp_std::marker::PhantomData; | ||
|
||
/// Resets the CollectedFees. | ||
pub struct Migration<T: Config>(PhantomData<T>); | ||
|
||
impl<T: Config> OnRuntimeUpgrade for Migration<T> { | ||
fn on_runtime_upgrade() -> frame_support::weights::Weight { | ||
log::info!("Deleting CollectedNetworkFee"); | ||
CollectedNetworkFee::<T>::kill(); | ||
Zero::zero() | ||
} | ||
|
||
#[cfg(feature = "try-runtime")] | ||
fn post_upgrade(_state: Vec<u8>) -> Result<(), frame_support::sp_runtime::TryRuntimeError> { | ||
ensure!(CollectedNetworkFee::<T>::get() == 0, "CollectedNetworkFee should be zero"); | ||
Ok(()) | ||
} | ||
} |
Oops, something went wrong.