From b2c37911ff3bd17aaeea9d54bf54a60b96a2a50f Mon Sep 17 00:00:00 2001 From: Niklas Adofsson Date: Thu, 23 Aug 2018 13:30:05 +0200 Subject: [PATCH 1/2] Update recommended version number in the readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ed67d2..cde21ce 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ To specify a dependency, add to `Cargo.toml` ```toml [dependencies] -ethereum-types = "0.3" +ethereum-types = "0.4" ``` Little example @@ -34,5 +34,5 @@ in a `no_std` context, add the following to your `Cargo.toml`: ```toml [dependencies] -ethereum-types = { version = "0.3", default-features = false } +ethereum-types = { version = "0.4", default-features = false } ``` From 2f459c34fa6912736ceb29fc135fc38649c2a25b Mon Sep 17 00:00:00 2001 From: Niklas Adofsson Date: Sun, 2 Sep 2018 20:45:45 +0200 Subject: [PATCH 2/2] More accurate description of the repo --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cde21ce..65c49de 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,25 @@ -# bigint +# Ethereum primitives [![Build Status](https://travis-ci.org/paritytech/primitives.svg?branch=master)](https://travis-ci.org/paritytech/primitives) -Fixed-sized integers arithmetic +Fixed-sized integer arithmetic (ethereum-types) and bloom filter (ethbloom) -To specify a dependency, add to `Cargo.toml` +To add this crate to your project, add the following in `Cargo.toml` ```toml [dependencies] ethereum-types = "0.4" +ethbloom = "0.5" ``` -Little example +A basic example how to use this crate: ```rust extern crate ethereum_types; +extern crate ethbloom; + use ethereum_types::U256; +use ethbloom::{Bloom, Input}; fn main() { let mut val: U256 = 1023.into(); @@ -24,7 +28,13 @@ fn main() { &format!("{}", val), "1643897619276947051879427220465009342380213662639797070513307648" ); + + let address = [0_u8; 32]; + let mut my_bloom = Bloom::default(); + assert!(!my_bloom.contains_input(Input::Raw(&address))); + my_bloom.accrue(Input::Raw(&address)); } + ``` ### `no_std` crates @@ -35,4 +45,5 @@ in a `no_std` context, add the following to your `Cargo.toml`: ```toml [dependencies] ethereum-types = { version = "0.4", default-features = false } +ethbloom = { version = "0.5", default-features = false } ```