Browse Source

crate

master
arnaucube 4 years ago
parent
commit
0f9282e74e
6 changed files with 16 additions and 11 deletions
  1. +6
    -1
      Cargo.toml
  2. +1
    -1
      README.md
  3. +1
    -1
      src/db.rs
  4. +4
    -4
      src/lib.rs
  5. +2
    -2
      src/node.rs
  6. +2
    -2
      src/utils.rs

+ 6
- 1
Cargo.toml

@ -1,7 +1,12 @@
[package]
name = "merkletree-rs"
version = "0.0.1"
authors = ["arnaucube <arnaucube@gmail.com>"]
authors = ["arnaucube <root@arnaucube.com>"]
edition = "2018"
license = "GPL-3.0"
description = "Sparse MerkleTree"
repository = "https://github.com/arnaucube/merkletree-rs"
readme = "README.md"
[dependencies]
tiny-keccak = "1.4.2"

+ 1
- 1
README.md

@ -1,4 +1,4 @@
# merkletree-rs [![Build Status](https://travis-ci.org/arnaucube/merkletree-rs.svg?branch=master)](https://travis-ci.org/arnaucube/merkletree-rs)
# merkletree-rs [![Crates.io](https://img.shields.io/crates/v/merkletree-rs.svg)](https://crates.io/crates/merkletree-rs) [![Build Status](https://travis-ci.org/arnaucube/merkletree-rs.svg?branch=master)](https://travis-ci.org/arnaucube/merkletree-rs)
Sparse MerkleTree implementation in Rust.
The MerkleTree is optimized in the design and concepts, to have a faster and lighter MerkleTree, maintaining compatibility with a non optimized MerkleTree. In this way, the MerkleRoot of the optimized MerkleTree will be the same that the MerkleRoot of the non optimized MerkleTree.

+ 1
- 1
src/db.rs

@ -2,7 +2,7 @@ extern crate rusty_leveldb;
use self::rusty_leveldb::DB;
use constants;
use super::constants;
pub struct Db {
storage: DB,

+ 4
- 4
src/lib.rs

@ -6,10 +6,10 @@ extern crate tiny_keccak;
use rustc_hex::ToHex;
mod constants;
mod db;
mod node;
mod utils;
pub mod constants;
pub mod db;
pub mod node;
pub mod utils;
type Result<T> = std::result::Result<T, String>;

+ 2
- 2
src/node.rs

@ -1,5 +1,5 @@
use constants;
use utils;
use super::constants;
use super::utils;
pub struct TreeNode {
pub child_l: [u8; 32],

+ 2
- 2
src/utils.rs

@ -1,5 +1,5 @@
use constants;
use node;
use super::constants;
use super::node;
use tiny_keccak::Keccak;
pub fn hash_vec(b: Vec<u8>) -> [u8; 32] {

Loading…
Cancel
Save