Skip to content

Commit

Permalink
Update dependencies (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc authored May 1, 2023
1 parent 6f63405 commit 7d21583
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "ethabi-decode"
version = "1.3.3"
version = "1.4.0"
authors = ["Vincent Geddes <vincent.geddes@hey.com>"]
edition = "2021"
license = "Apache-2.0"
keywords = ["ethereum", "eth", "abi", "solidity"]
description = "Decoding of ABI-encoded data and event logs"

[dependencies]
tiny-keccak = { version = "1.4" }
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
ethereum-types = { version = "0.14.1", default-features = false }

[dev-dependencies]
hex = { version = "2.0", package = "rustc-hex" }
hex-literal = "0.2.1"
uint = { version = "0.8.2", default-features = false }
paste = "0.1.6"
hex-literal = "0.4.0"
uint = { version = "0.9.5", default-features = false }
paste = "1.0.12"

[features]
default = ["std"]
Expand Down
4 changes: 2 additions & 2 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! ABI encoder.

use crate::{util::pad_u32, Token, Word};
use tiny_keccak::Keccak;
use tiny_keccak::{Hasher, Keccak};
use crate::std::{vec, Vec};

fn pad_bytes(bytes: &[u8]) -> Vec<Word> {
Expand Down Expand Up @@ -131,7 +131,7 @@ pub fn encode(tokens: &[Token]) -> Vec<u8> {

pub fn encode_function(signature: &str, inputs: &[Token]) -> Vec<u8> {
let mut signed: [u8; 4] = [0; 4];
let mut sponge = Keccak::new_keccak256();
let mut sponge = Keccak::v256();
sponge.update(signature.as_ref());
sponge.finalize(&mut signed);
let encoded = encode(inputs);
Expand Down
10 changes: 5 additions & 5 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 <LICENSE or
// http://www.apache.org/licenses/LICENSE-2.0>. This file may not be
// http://www.apache.org/licenses/LICENSE-2.0>. This file may not be
// copied, modified, or distributed except according to those terms.

//! Contract event.
use crate::std::BTreeMap;
use crate::std::Vec;
use tiny_keccak::Keccak;
use tiny_keccak::{Hasher, Keccak};

use crate::{decode, Error, Param, ParamKind, Token, H256};

Expand All @@ -29,7 +29,7 @@ pub struct Event<'a> {
impl<'a> Event<'a> {
fn signature_keccak256(&self) -> H256 {
let mut result = [0u8; 32];
let mut sponge = Keccak::new_keccak256();
let mut sponge = Keccak::v256();
sponge.update(self.signature.as_ref());
sponge.finalize(&mut result);
result.into()
Expand Down Expand Up @@ -115,11 +115,11 @@ mod tests {

use crate::{token::Token, Event, Param, ParamKind, H256};
use hex::FromHex;
use tiny_keccak::Keccak;
use tiny_keccak::{Hasher, Keccak};

fn keccak256(data: &str) -> H256 {
let mut result = [0u8; 32];
let mut sponge = Keccak::new_keccak256();
let mut sponge = Keccak::v256();
sponge.update(data.as_ref());
sponge.finalize(&mut result);
result.into()
Expand Down

0 comments on commit 7d21583

Please sign in to comment.