Skip to content

Commit 7a549c3

Browse files
committed
feat(bitcoin): <- rm all block rpc downloading stuff from that
1 parent 796980b commit 7a549c3

10 files changed

+2
-213
lines changed

app/jni/bitcoin/src/btc_blocks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::{
2-
btc_block_json::{BtcBlockJson, BtcBlockJsons},
2+
btc_block_json::BtcBlockJsons,
33
BtcError,
44
};
55
use bitcoin::blockdata::block::Block as BtcBlock;

app/jni/bitcoin/src/constants.rs

-5
This file was deleted.

app/jni/bitcoin/src/curl.rs

-21
This file was deleted.

app/jni/bitcoin/src/error.rs

-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::constants::MAX_NUM_BLOCKS;
21
use thiserror::Error;
32

43
#[derive(Debug, Error)]
@@ -9,27 +8,18 @@ pub enum BtcError {
98
#[error("validation error - check logs for details")]
109
ValidationError,
1110

12-
#[error("cannot get block with hash: {0}")]
13-
NoBlock(bitcoin::BlockHash),
14-
1511
#[error("no blocks were passed in")]
1612
NoBlocks,
1713

1814
#[error("hex array error: {0}")]
1915
HexArray(#[from] bitcoin::hex::HexToArrayError),
2016

21-
#[error("http json response error: {0}")]
22-
HttpJsonResponse(String),
23-
2417
#[error("serde json error: {0}")]
2518
SerdeJson(#[from] serde_json::Error),
2619

2720
#[error("utf8 error: {0}")]
2821
Utf8(#[from] std::str::Utf8Error),
2922

30-
#[error("timed out error: {0}")]
31-
TimedOut(String),
32-
3323
#[error("btc consensus encode error: {0}")]
3424
BtcConsensusEncode(#[from] bitcoin::consensus::encode::Error),
3525

@@ -42,9 +32,6 @@ pub enum BtcError {
4232
#[error("parse int error: {0}")]
4333
ParseInt(#[from] std::num::ParseIntError),
4434

45-
#[error("{0} is > than MAX_NUM_BLOCK of {MAX_NUM_BLOCKS}")]
46-
TooManyBlocks(u64),
47-
4835
#[error("i/o error: {0}")]
4936
Io(#[from] std::io::Error),
5037
}

app/jni/bitcoin/src/get_block_hashes.rs

-55
This file was deleted.

app/jni/bitcoin/src/get_blocks.rs

-56
This file was deleted.

app/jni/bitcoin/src/json_response.rs

-36
This file was deleted.

app/jni/bitcoin/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
mod btc_block_json;
22
mod btc_blocks;
3-
mod constants;
4-
mod curl;
53
mod error;
6-
mod get_block_hashes;
74
mod validate_input;
8-
mod get_blocks;
9-
mod json_response;
105
mod test_utils;
11-
mod write_blocks;
126

137
#[macro_use]
148
extern crate log;

app/jni/bitcoin/src/validate_input.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
error::BtcError,
44
};
55

6-
use std::{hash::Hash, str::FromStr};
6+
use std::str::FromStr;
77

88
pub fn validate_input(s: String) -> Result<String, BtcError> {
99
let blocks = BtcBlocks::from_str(&s).expect("to unwrap btc blocks");

app/jni/bitcoin/src/write_blocks.rs

-19
This file was deleted.

0 commit comments

Comments
 (0)