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] ApplySystem uses network when it shouldn't #109

Open
notdanilo opened this issue Dec 2, 2024 · 2 comments
Open

[Bug] ApplySystem uses network when it shouldn't #109

notdanilo opened this issue Dec 2, 2024 · 2 comments
Labels
enhancement New feature or request priority: low

Comments

@notdanilo
Copy link
Contributor

Describe the bug
ApplySystem should simply return an instruction while it internally uses a provider.

provider.ts:91 Uncaught (in promise) Error: Provider local is not available on browser.
    at AnchorProvider.local (provider.ts:91:1)
    at getProvider (provider.ts:416:1)
    at new Program (index.ts:281:1)
    at transactions.ts:333:1
    at step (index.ts:87:1)
    at Object.next (index.ts:87:1)
    at index.ts:87:1
    at new Promise (<anonymous>)
    at __webpack_modules__../node_modules/@magicblock-labs/bolt-sdk/lib/world/transactions.js.__awaiter (index.ts:87:1)
    at createApplySystemInstruction (transactions.ts:331:1)

To Reproduce
Call ApplySystem

Expected behavior
It should simply return the Instruction and a Transaction with the Instruction

@notdanilo notdanilo added bug Something isn't working priority: high priority: low and removed priority: high bug Something isn't working labels Dec 2, 2024
@notdanilo
Copy link
Contributor Author

I am no longer considering it a bug as we can use setProvider as intended by anchor to make ApplySystem work (it relies on getProvider)

@notdanilo notdanilo added the enhancement New feature or request label Dec 6, 2024
@notdanilo
Copy link
Contributor Author

But it makes sense for me for functions to create instructions to be always sync without the need to interact with the network. But to make it happen, some API redesign might be necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

1 participant