streamingfast / substreams-template

Apache License 2.0
22 stars 11 forks source link

ABI generation for erc1155 doesn't build #14

Closed ballon3 closed 2 years ago

ballon3 commented 2 years ago

Using the erc1155 abi it seems to have a type error on the abi generated code for this proto even when the proto fields are just to and from indexed fields on the TransferSingle event it still complains on the id parameter in the generated codebase.

   --> src/abi/erc1155.rs:441:28
    |
441 |                       value: ethabi::decode(
    |  ____________________________^
442 | |                             &[ethabi::ParamType::Uint(256usize)],
443 | |                             log.topics[1usize].as_ref(),
444 | |                         )
...   |
451 | |                         .into_uint()
452 | |                         .expect(INTERNAL_ERR),
    | |_____________________________________________^ expected struct `std::string::String`, found struct `U256`
    |
help: try using a conversion method
    |
452 |                         .expect(INTERNAL_ERR).to_string(),
    |                                              ++++++++++++
452 |                         .expect(INTERNAL_ERR).to_string(),
    |                                              ++++++++++++

error[E0308]: mismatched types
   --> src/abi/erc1155.rs:453:25
    |
453 |                       id: values
    |  _________________________^
454 | |                         .pop()
455 | |                         .expect(INTERNAL_ERR)
456 | |                         .into_string()
457 | |                         .expect(INTERNAL_ERR),
    | |_____________________________________________^ expected struct `U256`, found struct `std::string::String`
fubhy commented 2 years ago

That's fixed here: https://github.com/streamingfast/substreams-ethereum/pull/1