Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected web3::contract::tokens::Tokenize is not implemented error #304

Closed
chabashilah opened this issue Jan 10, 2020 · 2 comments · Fixed by #307
Closed

Unexpected web3::contract::tokens::Tokenize is not implemented error #304

chabashilah opened this issue Jan 10, 2020 · 2 comments · Fixed by #307

Comments

@chabashilah
Copy link
Contributor

Hi,

When I compiled my code which contains a smart contract invocation, I got a following error.

error[E0277]: the trait bound `([web3::types::H160; 3], [web3::types::U128; 8], [web3::types::U256; 6], [web3::types::H256; 5], std::string::String): web3::contract::tokens::Tokenize` is not satisfied
  --> src/bin/call_func.rs:69:51
   |
69 |       let call_future = contract.call("test", (
   |  ___________________________________________________^
70 | |         ary1,
71 | |         ary2,
72 | |         ary3,
73 | |         ary4,
74 | |         "test_text".to_string(),
75 | |     ), owner_address, write_options);
   | |_____^ the trait `web3::contract::tokens::Tokenize` is not implemented for `([web3::types::H160; 3], [web3::types::U128; 8], [web3::types::U256; 6], [web3::types::H256; 5], std::string::String)`
   |
   = help: the following implementations were found:
             <(A, B, C, D, E) as web3::contract::tokens::Tokenize>

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `relayer`.

To learn more, run the command again with --verbose.

However, when I change ary3 length from 6 to 8, the compile went well.
Does the array length affect to the compile result?

Thank you

@tomusdrw
Copy link
Owner

Yeah, unfortunately Rust requires us to implement this trait manually for every size and it was only implemented for 5 and then 8 and 16. I've added implementations for up to 16 elements and then power of two in #307

@chabashilah
Copy link
Contributor Author

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants