pub struct ChangeSet<K> {
pub keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>,
pub last_revealed: BTreeMap<DescriptorId, u32>,
}
Expand description
Represents updates to the derivation index of a KeychainTxOutIndex
.
It maps each keychain K
to a descriptor and its last revealed index.
It can be applied to KeychainTxOutIndex
with apply_changeset
. `ChangeSet are
monotone in that they will never decrease the revealed derivation index.
Fields§
§keychains_added: BTreeMap<K, Descriptor<DescriptorPublicKey>>
Contains the keychains that have been added and their respective descriptor
last_revealed: BTreeMap<DescriptorId, u32>
Contains for each descriptor_id the last revealed index of derivation
Trait Implementations§
source§impl<K: Ord> Append for ChangeSet<K>
impl<K: Ord> Append for ChangeSet<K>
source§fn append(&mut self, other: Self)
fn append(&mut self, other: Self)
Append another ChangeSet
into self.
For each keychain in keychains_added
in the given ChangeSet
:
If the keychain already exist with a different descriptor, we overwrite the old descriptor.
For each last_revealed
in the given ChangeSet
:
If the keychain already exists, increase the index when the other’s index > self’s index.