mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
structs: fix locktime conversion to bitcoin::locktime
This commit is contained in:
@@ -28,7 +28,7 @@ This crate provides a thin wrapper around the Rolldown JavaScript bundler specif
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_bundler
|
||||
```
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ This crate provides a sophisticated analytics engine that processes indexed Bitc
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_computer
|
||||
```
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ This crate provides a unified error type that consolidates error handling across
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_error
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ This crate provides a unified interface for fetching Bitcoin price data from mul
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_fetcher
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ This crate provides a comprehensive Bitcoin blockchain indexer built on top of `
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_indexer
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ This crate provides a high-level interface for querying and formatting data from
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_interface
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ This crate provides a thin wrapper around `env_logger` with enhanced formatting,
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_logger
|
||||
```
|
||||
|
||||
|
||||
@@ -26,13 +26,23 @@ This crate provides a Model Context Protocol (MCP) server implementation that ex
|
||||
- AI-driven financial analysis requiring Bitcoin metrics
|
||||
- Automated research tools with natural language queries
|
||||
|
||||
## Installation
|
||||
## Claude
|
||||
|
||||
```toml
|
||||
### Quick Start
|
||||
|
||||
Add a `bitview` custom connector with the following URL:
|
||||
|
||||
`https://bitview.space/mcp`
|
||||
|
||||
## Rust
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
cargo add brk_mcp
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
### Quick Start
|
||||
|
||||
```rust
|
||||
use brk_mcp::MCP;
|
||||
|
||||
@@ -28,7 +28,7 @@ This crate provides a multi-threaded Bitcoin block parser that processes raw Bit
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_parser
|
||||
```
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ This crate provides a high-performance HTTP server built on `axum` that exposes
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_server
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ This crate provides a type-safe wrapper around the Fjall LSM-tree database engin
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_store
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ This crate provides a comprehensive type system for Bitcoin blockchain analysis,
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
```bash
|
||||
cargo add brk_structs
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use bitcoin::absolute::LockTime;
|
||||
use bitcoin::{absolute::LockTime, locktime::absolute::LOCK_TIME_THRESHOLD};
|
||||
use serde::Serialize;
|
||||
use vecdb::StoredCompressed;
|
||||
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
||||
@@ -14,12 +14,10 @@ impl From<LockTime> for RawLockTime {
|
||||
}
|
||||
}
|
||||
|
||||
const CONSENSUS_DELIMITER: u32 = 500_000_000;
|
||||
|
||||
impl From<RawLockTime> for LockTime {
|
||||
fn from(value: RawLockTime) -> Self {
|
||||
let value = value.0;
|
||||
if value >= CONSENSUS_DELIMITER {
|
||||
if value < LOCK_TIME_THRESHOLD {
|
||||
bitcoin::locktime::absolute::Height::from_consensus(value)
|
||||
.unwrap()
|
||||
.into()
|
||||
|
||||
Reference in New Issue
Block a user