-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from TheWaWaR/ckb-0.17
feat: Mock transaction support in ckb-sdk
- Loading branch information
Showing
42 changed files
with
1,956 additions
and
2,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,19 @@ | |
name = "ckb-cli" | ||
version = "0.17.0" | ||
license = "MIT" | ||
authors = ["Linfeng Qian <[email protected]>"] | ||
authors = ["Linfeng Qian <[email protected]>", "Nervos Core Dev <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
numext-fixed-hash = "~0.1" | ||
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", branch = "develop", features = ["secp", "bech32"] } | ||
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-core = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-util = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17", features = ["secp", "bech32"] } | ||
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-core = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-util = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-sdk = { path = "ckb-sdk" } | ||
ckb-index = { path = "ckb-index" } | ||
|
||
jsonrpc-client-core = "0.5.0" | ||
secp256k1 = {version = "0.12.2" } | ||
|
@@ -25,6 +26,7 @@ clap = "2.33.0" | |
serde = { version = "1.0", features = ["rc"] } | ||
serde_derive = "1.0" | ||
serde_json = "1.0" | ||
serde_yaml = "0.8.9" | ||
yaml-rust = "0.4.3" | ||
dtoa = "0.4" | ||
ansi_term = "^0.11.0" | ||
|
@@ -44,7 +46,7 @@ tui = "0.6.0" | |
termion = "1.5" | ||
|
||
[build-dependencies] | ||
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-build-info = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
|
||
[workspace] | ||
members = ["ckb-sdk"] | ||
members = ["ckb-sdk", "ckb-index"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
name = "ckb-index" | ||
version = "0.17.0" | ||
authors = ["Linfeng Qian <[email protected]>", "Nervos Core Dev <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT" | ||
|
||
[dependencies] | ||
serde = { version = "1.0", features = ["rc"] } | ||
serde_derive = "1.0" | ||
numext-fixed-hash = "~0.1" | ||
bincode = "1.1.4" | ||
log = "0.4.6" | ||
rocksdb = { version = "0.12.2", default-features = false } | ||
failure = "0.1.5" | ||
|
||
ckb-core = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-sdk = { path = "../ckb-sdk" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use std::io; | ||
|
||
use failure::Fail; | ||
|
||
use crate::index::IndexError; | ||
|
||
#[derive(Debug, Fail)] | ||
pub enum Error { | ||
#[fail(display = "Rocksdb error: {}", _0)] | ||
Rocksdb(rocksdb::Error), | ||
#[fail(display = "IO error: {}", _0)] | ||
Io(io::Error), | ||
#[fail(display = "Index DB error: {}", _0)] | ||
Index(IndexError), | ||
#[fail(display = "Other error: {}", _0)] | ||
Other(String), | ||
} | ||
|
||
impl From<io::Error> for Error { | ||
fn from(err: io::Error) -> Error { | ||
Error::Io(err) | ||
} | ||
} | ||
|
||
impl From<rocksdb::Error> for Error { | ||
fn from(err: rocksdb::Error) -> Error { | ||
Error::Rocksdb(err) | ||
} | ||
} | ||
|
||
impl From<IndexError> for Error { | ||
fn from(err: IndexError) -> Error { | ||
Error::Index(err) | ||
} | ||
} | ||
|
||
impl From<String> for Error { | ||
fn from(err: String) -> Error { | ||
Error::Other(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mod error; | ||
mod index; | ||
mod kvdb; | ||
mod util; | ||
|
||
pub use error::Error; | ||
pub use index::{ | ||
CellIndex, HashType, IndexDatabase, IndexError, Key as IndexKey, KeyMetrics as IndexKeyMetrics, | ||
KeyType as IndexKeyType, LiveCellInfo, TxInfo, | ||
}; | ||
pub use kvdb::{KVReader, KVTxn, RocksReader, RocksTxn}; | ||
pub use util::{with_index_db, with_rocksdb}; | ||
|
||
const ROCKSDB_COL_INDEX_DB: &str = "index-db"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "ckb-sdk" | ||
version = "0.17.0" | ||
authors = ["Linfeng Qian <[email protected]>"] | ||
authors = ["Linfeng Qian <[email protected]>", "Nervos Core Dev <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT" | ||
|
||
|
@@ -12,12 +12,9 @@ serde_json = "1.0" | |
numext-fixed-hash = "~0.1" | ||
bech32 = "0.6.0" | ||
bytes = { version="0.4", features = ["serde"] } | ||
bincode = "1.1.4" | ||
log = "0.4.6" | ||
# fs2 = "0.4.3" | ||
jsonrpc-client-core = "0.5.0" | ||
jsonrpc-client-http = "0.5.0" | ||
rocksdb = { version = "0.12.2", default-features = false } | ||
secp256k1 = {version = "0.12.2" } | ||
faster-hex = "0.3" | ||
fnv = "1.0.3" | ||
|
@@ -31,8 +28,8 @@ uuid = { version = "0.7.4", features = ["v4"] } | |
chrono = "0.4.6" | ||
failure = "0.1.5" | ||
|
||
ckb-core = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-script = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", branch = "develop" } | ||
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", branch = "develop", features = ["secp", "bech32"] } | ||
ckb-core = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-script = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-jsonrpc-types = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-hash = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17" } | ||
ckb-crypto = { git = "https://github.com/nervosnetwork/ckb", branch = "rc/v0.17", features = ["secp", "bech32"] } |
Oops, something went wrong.