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

[BUG] sozo typescript binding issues #2382

Closed
rsodre opened this issue Sep 3, 2024 · 5 comments
Closed

[BUG] sozo typescript binding issues #2382

rsodre opened this issue Sep 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@rsodre
Copy link

rsodre commented Sep 3, 2024

Describe the bug

Some types and functions on pistols are not being ported to typescript correctly with sozo build --typescript

To Reproduce

  • clone pistols
  • uncomment binding generation on the migration script
  • run ./migration
  • check files at ./bindings/typescript
  • (generated files are attached below)

Issues and Screenshots

  • contracts.gen.ts: enum Archetype not being exported
Screenshot 2024-09-03 at 14 32 14
#[derive(Serde, Copy, Drop, PartialEq, Introspect)]
enum Archetype {
    Undefined,  // 0
    Villainous, // 1
    Trickster,  // 2
    Honourable, // 3
}
  • Block-scoped variable 'U256Definition' used before its declaration. Same on ScoreDefinition, ShotDefinition,
Screenshot 2024-09-03 at 15 03 38 Screenshot 2024-09-03 at 15 04 58
    fn validate_commit_message(world: @IWorldDispatcher,
        account: ContractAddress,
        signature: Array<felt252>,
        duelId: felt252,
        roundNumber: felt252,
        duelistId: felt252,
    ) -> bool;
Screenshot 2024-09-03 at 15 08 14
  • balance_of() method, from origami's erc20_balance and erc721_balance has duplicated argument account. The same happens to other functions that include an account argument in contraxcts.gen.ts.
Screenshot 2024-09-03 at 15 10 50

Additional context

Dojo 1.0.0-alpha.9

generated sources: pistols.gen.zip

@rsodre rsodre added the bug Something isn't working label Sep 3, 2024
@Luluameh
Copy link

Luluameh commented Sep 5, 2024

hello @rsodre kindly assign me this issue

@Agbeleshe
Copy link

Agbeleshe commented Sep 5, 2024

Hi, I am interested in debugging this issue @rsodre .

@rsodre
Copy link
Author

rsodre commented Sep 5, 2024

I'm not in charge of assignments on dojo

@Agbeleshe
Copy link

@rsodre Thanks for the update. Please who's attention should be draw concerning this task

@glihm
Copy link
Collaborator

glihm commented Oct 15, 2024

@rsodre @Agbeleshe this is tackled in #2501 which should be significantly different.

@glihm glihm closed this as completed Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants