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

fix: support latest soroban-examples #97

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

chadoh
Copy link
Contributor

@chadoh chadoh commented Jul 31, 2024

The system-test started failing in stellar/stellar-cli#1500 because it finally updated the version of soroban-examples to use a version that includes stellar/soroban-examples#314. The previous invoke.ts logic assumed that the variable would be a Symbol, but the variable has been changed to a String.

I don't want to break every project that still uses system-test with a stale soroban-examples hash, so here's what I did:

  • dynamically define contract using import(), using a @ts-ignore directive because this can error if stellar-sdk doesn't include a contract export.
  • if contract is there, then we don't need to know the type of the argument. It could be a Symbol or a String or anything else.
  • non-contract logic path stays unchanged, assuming Symbol

The system-test started failing in
stellar/stellar-cli#1500 because it finally
updated the version of `soroban-examples` to use a version that includes
stellar/soroban-examples#314. The previous
`invoke.ts` logic assumed that the variable would be a Symbol, but the
variable has been changed to a String.

I don't want to break every project that still uses `system-test` with a
stale `soroban-examples` hash, so here's what I did:

- dynamically define `contract` using `import()`, using a `@ts-ignore`
  directive because this can error if `stellar-sdk` doesn't include a
  `contract` export.
- if `contract` is there, then we don't need to know the type of the
  argument. It could be a Symbol or a String or anything else.
- non-`contract` logic path stays unchanged, assuming `Symbol`
@leighmcculloch leighmcculloch merged commit a0b9d3e into stellar:master Jul 31, 2024
3 checks passed
@chadoh chadoh deleted the fix/latest-examples branch July 31, 2024 22:45
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.

2 participants