Skip to content

Commit

Permalink
add h256 decode support (ontio#69)
Browse files Browse the repository at this point in the history
* add h256 decode support

* update travis rustup version

* update travis

* add feature in codegen
  • Loading branch information
lucas7788 authored Apr 16, 2020
1 parent 11f4671 commit 9051fdf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: rust
rust:
- nightly
- nightly-2019-10-28
sudo: false
cache: cargo

Expand Down
3 changes: 3 additions & 0 deletions ontio-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ heck = {version = "0.3.1",default-features = false}

[dev-dependencies]
ontio-std = {path="../ontio-std"}

[features]
mock = ["ontio-std/mock"]
6 changes: 6 additions & 0 deletions ontio-std/src/abi/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ impl<'a> Decoder<'a> for &'a H256 {
}
}

impl<'a> Decoder<'a> for H256 {
fn decode(source: &mut Source<'a>) -> Result<Self, Error> {
source.read_h256().map(H256::clone)
}
}

impl<'a> Decoder<'a> for u128 {
fn decode(source: &mut Source<'a>) -> Result<Self, Error> {
source.read_u128()
Expand Down

0 comments on commit 9051fdf

Please sign in to comment.