Skip to content

Commit

Permalink
(rollback) cherry-pick: include system vault address (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnjscksdn98 authored Dec 5, 2024
1 parent d7a13a3 commit 08764c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
28 changes: 9 additions & 19 deletions precompiles/btc-registration-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,27 +213,17 @@ where
) -> EvmResult<Vec<BitcoinAddressString>> {
handle.record_cost(RuntimeHelper::<Runtime>::db_read_gas_cost())?;

let target_round = Self::target_round(pool_round);
let mut vault_addresses: Vec<BitcoinAddressString> =
pallet_btc_registration_pool::RegistrationPool::<Runtime>::iter_prefix(target_round)
.filter_map(|(_, relay_target)| match relay_target.vault.address {
AddressState::Pending => None,
AddressState::Generated(address) => {
Some(BitcoinAddressString::from(address.into_inner()))
},
})
.collect();
// add system vault if it exists
if let Some(system_vault) =
pallet_btc_registration_pool::SystemVault::<Runtime>::get(target_round)
{
match system_vault.address {
AddressState::Pending => (),
let vault_addresses: Vec<BitcoinAddressString> =
pallet_btc_registration_pool::RegistrationPool::<Runtime>::iter_prefix(
Self::target_round(pool_round),
)
.filter_map(|(_, relay_target)| match relay_target.vault.address {
AddressState::Pending => None,
AddressState::Generated(address) => {
vault_addresses.push(BitcoinAddressString::from(address.into_inner()));
Some(BitcoinAddressString::from(address.into_inner()))
},
}
}
})
.collect();

Ok(vault_addresses)
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// The version of the authorship interface.
authoring_version: 1,
// The version of the runtime spec.
spec_version: 2025,
spec_version: 2026,
// The version of the implementation of the spec.
impl_version: 1,
// A list of supported runtime APIs along with their versions.
Expand Down

0 comments on commit 08764c1

Please sign in to comment.