Skip to content

Commit

Permalink
cargo fmt all.
Browse files Browse the repository at this point in the history
  • Loading branch information
YancyParker committed Jan 30, 2024
1 parent baf0544 commit ad642db
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples/book_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ fn main() {

let input_data = vec![60, 5, 111, 108, 97, 118, 109, 7, 120553111];

// Decode input
// Decode input
let (func, decoded_data) = abi.decode_input_from_slice(&input_data).unwrap();

println!("decode function input {:?}\n data {:?}", func.name, decoded_data);
println!(
"decode function input {:?}\n data {:?}",
func.name, decoded_data
);

// Decode output "hello"
let output_data = vec![5, 104, 101, 108, 108, 111, 6];

let decoded_data = abi.decode_output_from_slice(abi.functions[1].signature().as_str(), &output_data).unwrap();
let decoded_data = abi
.decode_output_from_slice(abi.functions[1].signature().as_str(), &output_data)
.unwrap();

println!("decode function output {:?}\n", decoded_data);

}

0 comments on commit ad642db

Please sign in to comment.