global: address -> addr rename

This commit is contained in:
nym21
2026-03-17 11:01:21 +01:00
parent 5609e6c010
commit f62943199c
141 changed files with 3788 additions and 3754 deletions
@@ -1,10 +1,10 @@
use brk_indexer::Indexer;
use brk_traversable::Traversable;
use brk_types::{
Address, AddressBytes, EmptyOutputIndex, OpReturnIndex, P2AAddressIndex, P2ABytes,
P2MSOutputIndex, P2PK33AddressIndex, P2PK33Bytes, P2PK65AddressIndex, P2PK65Bytes,
P2PKHAddressIndex, P2PKHBytes, P2SHAddressIndex, P2SHBytes, P2TRAddressIndex, P2TRBytes,
P2WPKHAddressIndex, P2WPKHBytes, P2WSHAddressIndex, P2WSHBytes, TxIndex, UnknownOutputIndex,
Addr, AddrBytes, EmptyOutputIndex, OpReturnIndex, P2AAddrIndex, P2ABytes,
P2MSOutputIndex, P2PK33AddrIndex, P2PK33Bytes, P2PK65AddrIndex, P2PK65Bytes,
P2PKHAddrIndex, P2PKHBytes, P2SHAddrIndex, P2SHBytes, P2TRAddrIndex, P2TRBytes,
P2WPKHAddrIndex, P2WPKHBytes, P2WSHAddrIndex, P2WSHBytes, TxIndex, UnknownOutputIndex,
Version,
};
use vecdb::{LazyVecFrom1, ReadableCloneableVec};
@@ -28,52 +28,52 @@ pub struct Vecs {
#[derive(Clone, Traversable)]
pub struct P2PK33Vecs {
pub identity:
LazyVecFrom1<P2PK33AddressIndex, P2PK33AddressIndex, P2PK33AddressIndex, P2PK33Bytes>,
pub address: LazyVecFrom1<P2PK33AddressIndex, Address, P2PK33AddressIndex, P2PK33Bytes>,
LazyVecFrom1<P2PK33AddrIndex, P2PK33AddrIndex, P2PK33AddrIndex, P2PK33Bytes>,
pub addr: LazyVecFrom1<P2PK33AddrIndex, Addr, P2PK33AddrIndex, P2PK33Bytes>,
}
#[derive(Clone, Traversable)]
pub struct P2PK65Vecs {
pub identity:
LazyVecFrom1<P2PK65AddressIndex, P2PK65AddressIndex, P2PK65AddressIndex, P2PK65Bytes>,
pub address: LazyVecFrom1<P2PK65AddressIndex, Address, P2PK65AddressIndex, P2PK65Bytes>,
LazyVecFrom1<P2PK65AddrIndex, P2PK65AddrIndex, P2PK65AddrIndex, P2PK65Bytes>,
pub addr: LazyVecFrom1<P2PK65AddrIndex, Addr, P2PK65AddrIndex, P2PK65Bytes>,
}
#[derive(Clone, Traversable)]
pub struct P2PKHVecs {
pub identity: LazyVecFrom1<P2PKHAddressIndex, P2PKHAddressIndex, P2PKHAddressIndex, P2PKHBytes>,
pub address: LazyVecFrom1<P2PKHAddressIndex, Address, P2PKHAddressIndex, P2PKHBytes>,
pub identity: LazyVecFrom1<P2PKHAddrIndex, P2PKHAddrIndex, P2PKHAddrIndex, P2PKHBytes>,
pub addr: LazyVecFrom1<P2PKHAddrIndex, Addr, P2PKHAddrIndex, P2PKHBytes>,
}
#[derive(Clone, Traversable)]
pub struct P2SHVecs {
pub identity: LazyVecFrom1<P2SHAddressIndex, P2SHAddressIndex, P2SHAddressIndex, P2SHBytes>,
pub address: LazyVecFrom1<P2SHAddressIndex, Address, P2SHAddressIndex, P2SHBytes>,
pub identity: LazyVecFrom1<P2SHAddrIndex, P2SHAddrIndex, P2SHAddrIndex, P2SHBytes>,
pub addr: LazyVecFrom1<P2SHAddrIndex, Addr, P2SHAddrIndex, P2SHBytes>,
}
#[derive(Clone, Traversable)]
pub struct P2TRVecs {
pub identity: LazyVecFrom1<P2TRAddressIndex, P2TRAddressIndex, P2TRAddressIndex, P2TRBytes>,
pub address: LazyVecFrom1<P2TRAddressIndex, Address, P2TRAddressIndex, P2TRBytes>,
pub identity: LazyVecFrom1<P2TRAddrIndex, P2TRAddrIndex, P2TRAddrIndex, P2TRBytes>,
pub addr: LazyVecFrom1<P2TRAddrIndex, Addr, P2TRAddrIndex, P2TRBytes>,
}
#[derive(Clone, Traversable)]
pub struct P2WPKHVecs {
pub identity:
LazyVecFrom1<P2WPKHAddressIndex, P2WPKHAddressIndex, P2WPKHAddressIndex, P2WPKHBytes>,
pub address: LazyVecFrom1<P2WPKHAddressIndex, Address, P2WPKHAddressIndex, P2WPKHBytes>,
LazyVecFrom1<P2WPKHAddrIndex, P2WPKHAddrIndex, P2WPKHAddrIndex, P2WPKHBytes>,
pub addr: LazyVecFrom1<P2WPKHAddrIndex, Addr, P2WPKHAddrIndex, P2WPKHBytes>,
}
#[derive(Clone, Traversable)]
pub struct P2WSHVecs {
pub identity: LazyVecFrom1<P2WSHAddressIndex, P2WSHAddressIndex, P2WSHAddressIndex, P2WSHBytes>,
pub address: LazyVecFrom1<P2WSHAddressIndex, Address, P2WSHAddressIndex, P2WSHBytes>,
pub identity: LazyVecFrom1<P2WSHAddrIndex, P2WSHAddrIndex, P2WSHAddrIndex, P2WSHBytes>,
pub addr: LazyVecFrom1<P2WSHAddrIndex, Addr, P2WSHAddrIndex, P2WSHBytes>,
}
#[derive(Clone, Traversable)]
pub struct P2AVecs {
pub identity: LazyVecFrom1<P2AAddressIndex, P2AAddressIndex, P2AAddressIndex, P2ABytes>,
pub address: LazyVecFrom1<P2AAddressIndex, Address, P2AAddressIndex, P2ABytes>,
pub identity: LazyVecFrom1<P2AAddrIndex, P2AAddrIndex, P2AAddrIndex, P2ABytes>,
pub addr: LazyVecFrom1<P2AAddrIndex, Addr, P2AAddrIndex, P2ABytes>,
}
#[derive(Clone, Traversable)]
@@ -101,114 +101,114 @@ impl Vecs {
Self {
p2pk33: P2PK33Vecs {
identity: LazyVecFrom1::init(
"p2pk33_address_index",
"p2pk33_addr_index",
version,
indexer.vecs.addresses.p2pk33.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2pk33.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2pk33_address",
addr: LazyVecFrom1::init(
"p2pk33_addr",
version,
indexer.vecs.addresses.p2pk33.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2pk33.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2pk65: P2PK65Vecs {
identity: LazyVecFrom1::init(
"p2pk65_address_index",
"p2pk65_addr_index",
version,
indexer.vecs.addresses.p2pk65.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2pk65.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2pk65_address",
addr: LazyVecFrom1::init(
"p2pk65_addr",
version,
indexer.vecs.addresses.p2pk65.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2pk65.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2pkh: P2PKHVecs {
identity: LazyVecFrom1::init(
"p2pkh_address_index",
"p2pkh_addr_index",
version,
indexer.vecs.addresses.p2pkh.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2pkh.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2pkh_address",
addr: LazyVecFrom1::init(
"p2pkh_addr",
version,
indexer.vecs.addresses.p2pkh.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2pkh.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2sh: P2SHVecs {
identity: LazyVecFrom1::init(
"p2sh_address_index",
"p2sh_addr_index",
version,
indexer.vecs.addresses.p2sh.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2sh.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2sh_address",
addr: LazyVecFrom1::init(
"p2sh_addr",
version,
indexer.vecs.addresses.p2sh.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2sh.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2tr: P2TRVecs {
identity: LazyVecFrom1::init(
"p2tr_address_index",
"p2tr_addr_index",
version,
indexer.vecs.addresses.p2tr.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2tr.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2tr_address",
addr: LazyVecFrom1::init(
"p2tr_addr",
version,
indexer.vecs.addresses.p2tr.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2tr.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2wpkh: P2WPKHVecs {
identity: LazyVecFrom1::init(
"p2wpkh_address_index",
"p2wpkh_addr_index",
version,
indexer.vecs.addresses.p2wpkh.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2wpkh.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2wpkh_address",
addr: LazyVecFrom1::init(
"p2wpkh_addr",
version,
indexer.vecs.addresses.p2wpkh.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2wpkh.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2wsh: P2WSHVecs {
identity: LazyVecFrom1::init(
"p2wsh_address_index",
"p2wsh_addr_index",
version,
indexer.vecs.addresses.p2wsh.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2wsh.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2wsh_address",
addr: LazyVecFrom1::init(
"p2wsh_addr",
version,
indexer.vecs.addresses.p2wsh.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2wsh.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2a: P2AVecs {
identity: LazyVecFrom1::init(
"p2a_address_index",
"p2a_addr_index",
version,
indexer.vecs.addresses.p2a.bytes.read_only_boxed_clone(),
indexer.vecs.addrs.p2a.bytes.read_only_boxed_clone(),
|index, _| index,
),
address: LazyVecFrom1::init(
"p2a_address",
addr: LazyVecFrom1::init(
"p2a_addr",
version,
indexer.vecs.addresses.p2a.bytes.read_only_boxed_clone(),
|_, bytes| Address::try_from(&AddressBytes::from(bytes)).unwrap(),
indexer.vecs.addrs.p2a.bytes.read_only_boxed_clone(),
|_, bytes| Addr::try_from(&AddrBytes::from(bytes)).unwrap(),
),
},
p2ms: P2MSVecs {
+5 -5
View File
@@ -1,4 +1,4 @@
mod address;
mod addr;
mod cached_mappings;
mod day1;
mod day3;
@@ -37,7 +37,7 @@ use crate::{
};
pub use cached_mappings::CachedMappings;
pub use address::Vecs as AddressVecs;
pub use addr::Vecs as AddrVecs;
pub use day1::Vecs as Day1Vecs;
pub use day3::Vecs as Day3Vecs;
pub use epoch::Vecs as EpochVecs;
@@ -65,7 +65,7 @@ pub struct Vecs<M: StorageMode = Rw> {
db: Database,
#[traversable(skip)]
pub cached_mappings: CachedMappings,
pub address: AddressVecs,
pub addr: AddrVecs,
pub height: HeightVecs<M>,
pub epoch: EpochVecs<M>,
pub halving: HalvingVecs<M>,
@@ -97,7 +97,7 @@ impl Vecs {
let version = parent_version;
let address = AddressVecs::forced_import(version, indexer);
let addr = AddrVecs::forced_import(version, indexer);
let height = HeightVecs::forced_import(&db, version)?;
let epoch = EpochVecs::forced_import(&db, version)?;
let halving = HalvingVecs::forced_import(&db, version)?;
@@ -138,7 +138,7 @@ impl Vecs {
let this = Self {
cached_mappings,
address,
addr,
height,
epoch,
halving,