Class: BSV::Wallet::LocalProofStore
- Inherits:
-
Object
- Object
- BSV::Wallet::LocalProofStore
- Includes:
- ProofStore
- Defined in:
- lib/bsv/wallet_interface/local_proof_store.rb
Overview
Default proof store — persists serialised merkle proofs via a StorageAdapter. Requires no external services.
Instance Method Summary collapse
-
#initialize(storage) ⇒ LocalProofStore
constructor
A new instance of LocalProofStore.
-
#resolve_proof(txid) ⇒ BSV::Transaction::MerklePath?
Resolve and deserialise a merkle proof.
-
#store_proof(txid, merkle_path) ⇒ void
Serialise and store a merkle proof.
Constructor Details
#initialize(storage) ⇒ LocalProofStore
Returns a new instance of LocalProofStore.
17 18 19 |
# File 'lib/bsv/wallet_interface/local_proof_store.rb', line 17 def initialize(storage) @storage = storage end |
Instance Method Details
#resolve_proof(txid) ⇒ BSV::Transaction::MerklePath?
Resolve and deserialise a merkle proof.
34 35 36 37 38 39 |
# File 'lib/bsv/wallet_interface/local_proof_store.rb', line 34 def resolve_proof(txid) bump_hex = @storage.find_proof(txid) return unless bump_hex BSV::Transaction::MerklePath.from_hex(bump_hex) end |
#store_proof(txid, merkle_path) ⇒ void
This method returns an undefined value.
Serialise and store a merkle proof.
26 27 28 |
# File 'lib/bsv/wallet_interface/local_proof_store.rb', line 26 def store_proof(txid, merkle_path) @storage.store_proof(txid, merkle_path.to_hex) end |