Skip to content

Commit

Permalink
Merge pull request #264 from 0xcregis/263-fix-ethereum-amount-too-lar…
Browse files Browse the repository at this point in the history
…ge-to-decode

fix: amount too large for u128
  • Loading branch information
loki-cmu authored Jul 31, 2024
2 parents a7a021b + 329d58b commit 1a047e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion anychain-ethereum/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "anychain-ethereum"
description = "A Rust library for Ethereum-focused cryptocurrency wallets, enabling seamless transactions on the Ethereum blockchain"
version = "0.1.15"
version = "0.1.16"
keywords = ["blockchain", "crypto", "cryptocurrencies", "ethereum", "wallet"]

# Workspace inherited keys
Expand Down
4 changes: 2 additions & 2 deletions anychain-ethereum/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ pub fn decode_transfer(data: Vec<u8>) -> Result<Value, TransactionError> {
match func.decode_input(&data[4..]) {
Ok(tokens) => {
let to = hex::encode(tokens[0].clone().into_address().unwrap().as_bytes());
let amount = tokens[1].clone().into_uint().unwrap().as_u128();
let amount = tokens[1].clone().into_uint().unwrap();
Ok(json!({
"function": "transfer",
"params": {
"to": to,
"amount": amount
"amount": amount.to_string(),
}
}))
}
Expand Down

0 comments on commit 1a047e1

Please sign in to comment.