Skip to content

Conversation

@palas
Copy link
Contributor

@palas palas commented Nov 13, 2025

Changelog

- description: |
    Add support for renaming JS methods re-exporting and use the functionality to simplify wallet testnet methods
  type:
  - breaking
  projects:
  - cardano-wasm

Context

See #1003 (comment). Names of functions exported by the API need to be unique, but we can rename them as we re-export them for the JS API function.

How to trust this PR

The tests passing gives strong guarantee the renaming is done correctly. Other than that, it could be that there is some file that wasn't updated that we missed. And also it would be a matter of checking whether the comments and code design is sensible.

I would look at the commit separately too, because the first one is a refactoring, and the second one is a simple change.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the methodParams field is it possible to encode the idea of sum type? I.e require a network magic number or default to mainnet?

@palas
Copy link
Contributor Author

palas commented Nov 14, 2025

In the methodParams field is it possible to encode the idea of sum type? I.e require a network magic number or default to mainnet?

@Jimbo4350, the easiest we could do is have a nullable magic number parameter (if it is the last parameter I think it could also be optional), and if you don't provide it we can default to mainnet. Still we can want the renaming functionality. Because that way we can have methods with the same name in different objects, like toCbor, otherwise we'll need txToCbor and certToCbor, because they are in the same namespace. This will still be the case at the WASM level, but we can structure them better for JS

@palas palas requested a review from Jimbo4350 November 14, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants