Skip to content

Commit

Permalink
fix: nicer value representation
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed May 2, 2024
1 parent ae68718 commit d9bb66c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ cargo run -- account-balance --interval 2.0 -c polygon -a 0x75be52afd54a13b6c984

http://deposit.dev.golem.network:15555/erc20/api/attestation/sepolia/0xeb9b088871155d0ae32f382de5a42d0a64e946f512b722698f4ae6b32164f92d
http://deposit.dev.golem.network:15555/erc20/api/attestation/sepolia/0xc8b0ceee393cdcf313945d20b3bd45a01b0ccf2484309b669da2d4da9266b4d5
http://deposit.dev.golem.network:15555/erc20/api/attestation/base/0xc0f18976a498f7287562492cca4a145108e83e3606e020f10653afd3511656ef
17 changes: 16 additions & 1 deletion crates/erc20_payment_lib/src/server/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,22 @@ pub async fn check_attestation(
decoded_items.push(AttestationItemInfo {
name: token_name.to_string(),
typ: token_type.to_string(),
value: token.to_string(),
value: match token {
ethabi::Token::Address(addr) => format!("{:#x}", addr),
ethabi::Token::FixedBytes(bytes) => hex::encode(bytes),
ethabi::Token::Int(int) => format!("{:#x}", int),
ethabi::Token::Uint(uint) => format!("{:#x}", uint),
ethabi::Token::Bool(b) => {
if *b {
"true".to_string()
} else {
"false".to_string()
}
}
ethabi::Token::String(s) => s.to_string(),
ethabi::Token::Bytes(bytes) => hex::encode(bytes),
_ => token.to_string(),
},
});
}

Expand Down

0 comments on commit d9bb66c

Please sign in to comment.