dojo icon indicating copy to clipboard operation
dojo copied to clipboard

[BUG] sozo typescript binding issues

Open rsodre opened this issue 1 year ago • 4 comments
trafficstars

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 avatar Sep 03 '24 19:09 rsodre

hello @rsodre kindly assign me this issue

Luluameh avatar Sep 05 '24 01:09 Luluameh

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

Agbeleshe avatar Sep 05 '24 02:09 Agbeleshe

I'm not in charge of assignments on dojo

rsodre avatar Sep 05 '24 12:09 rsodre

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

Agbeleshe avatar Sep 05 '24 15:09 Agbeleshe

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

glihm avatar Oct 15 '24 15:10 glihm