How to store I64 on indexer
chlenc opened this issue · 6 comments
chlenc commented
How to store I64 on indexer?
Hi guys, in my indexer I am going to store values with I64 type, on my contract, I have custom I64, I try to do like here but, I am having that error on indexer's lib.rs file
Looks like in the explorer example you are using I64 from sway libs, and I need to add some code to allow usage of my custom I64 standard
toolchain
Default host: aarch64-apple-darwin
fuelup home: /Users/alexey/.fuelup
installed toolchains
--------------------
latest-aarch64-apple-darwin (default)
beta-4-aarch64-apple-darwin
my-custom-toolchain
active toolchain
-----------------
latest-aarch64-apple-darwin (default)
forc : 0.46.1
- forc-client
- forc-deploy : 0.46.1
- forc-run : 0.46.1
- forc-doc : 0.46.1
- forc-explore : 0.28.1
- forc-fmt : 0.46.1
- forc-index : 0.24.1
- forc-lsp : 0.46.1
- forc-tx : 0.46.1
- forc-wallet : 0.3.0
fuel-core : 0.20.5
fuel-core-keygen : Error getting version string
fuel-indexer : 0.24.1
fuels versions
---------------
forc : 0.45
forc-wallet : 0.45
chlenc commented
ra0x3 commented
I64
is an indexer scalar type- You have redefined
I64
in your indexer module - You can't do that.
- Remove the
impl I64
line 4 and the error should be resolved
ra0x3 commented
- Here is a list of reserved names
- We enforce this in things like GraphQL schema and ABI JSON
- However we didn't enforce this in the entire Rust module because we didn't think it would happen
- We can update with an error to say
"This is a reserved name"
- We can update with an error to say
chlenc commented
Here is a list of reserved names
We enforce this in things like GraphQL schema and ABI JSON
However we didn't enforce this in the entire Rust module because we didn't think it would happen
- We can update with an error to say
"This is a reserved name"
removed I64 impl
on lines 4-8 and now have this error
ra0x3 commented
- To be clear, these issues are because of your incorrect usage of Rust, not because of the indexer (just want to make that clear)
- If the value is an
I64
why are you trying to convert it into aString
? Why not just useI64
in your schema? Is there a problem with that?
chlenc commented
- To be clear, these issues are because of your incorrect usage of Rust, not because of the indexer (just want to make that clear)
- If the value is an
I64
why are you trying to convert it into aString
? Why not just useI64
in your schema? Is there a problem with that?
I'm trying to use I64, but it gives the next error to me