Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

b256 usage #1477

Open
Tracked by #1470
Braqzen opened this issue Nov 22, 2023 · 3 comments
Open
Tracked by #1470

b256 usage #1477

Braqzen opened this issue Nov 22, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation sway

Comments

@Braqzen
Copy link
Contributor

Braqzen commented Nov 22, 2023

This will likely be a quick issue because it's probably a user (my) error.

When attempting to capture the b256 in the indexer it seemed like the Bytes32 types was not in the prelude and needed to be imported. When using (whatever) the default LSP import in VsCode for compilation there was a type mismatch and thus I couldn't get the indexer to build.

@ra0x3 ra0x3 self-assigned this Nov 29, 2023
@ra0x3
Copy link
Contributor

ra0x3 commented Nov 29, 2023

@Braqzen

  • Any more specific details here?
  • We definitely export Bytes32 and b256

@Braqzen
Copy link
Contributor Author

Braqzen commented Nov 29, 2023

@Braqzen

  • Any more specific details here?

  • We definitely export Bytes32 and b256

Sorry, all I recall is that I've tried to use the Bytes32 in the params for the indexer and it did not recognize it. I needed to import it and it automatically imported from the tx module from somewhere and that was incompatible.

Probably a user error somewhere.

@ra0x3
Copy link
Contributor

ra0x3 commented Nov 29, 2023

@Braqzen

  • Ahh I see, if you tried to do fn do_a_thing(b: Bytes32) that wouldn't work because Bytes32 is a scalar, and indexer handler functions only support those complex-ish types (e.g., fn do_a_thing(b: StructThatUsesBytes32Inside)
  • I'm seeing that a common theme here is:

You can only pass complex types to your indexer handlers

  • Another documentation thing
  • Open to suggestions here as well with regard to where we should put this in the docs

@ra0x3 ra0x3 added documentation Improvements or additions to documentation sway labels Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation sway
Projects
None yet
Development

No branches or pull requests

2 participants