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

😎 Runtime APIs #354

Merged
merged 1 commit into from
Jul 22, 2024
Merged

😎 Runtime APIs #354

merged 1 commit into from
Jul 22, 2024

Conversation

JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Jul 8, 2024

What?

Why?

Complex querying and calculations are done better in Rust with the full on-chain data and types than in Javascript on the front-end

Testing?

  • New file inside test folder "runtime_api.rs"

Anything Else?

To get an overview of the main changes, check out runtime_api.rs on /src and on /tests folders, as well as the new tests.rs file on the instantiator, where I test the new functions.

The rest of the changed files should be more about reflecting the changes of the instantiator functions

Copy link
Contributor Author

JuaniRios commented Jul 8, 2024

@JuaniRios JuaniRios changed the title Runtime APIs 😎 Runtime APIs Jul 8, 2024
@JuaniRios JuaniRios force-pushed the 07-08-runtime_apis branch 2 times, most recently from 1e5d5ad to 659df33 Compare July 9, 2024 11:22
@JuaniRios JuaniRios force-pushed the 07-08-runtime_apis branch 6 times, most recently from c53ecd6 to f456465 Compare July 19, 2024 14:04
@JuaniRios JuaniRios self-assigned this Jul 19, 2024
@JuaniRios JuaniRios marked this pull request as ready for review July 19, 2024 14:07
Copy link
Member

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

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

Great addition! The new Rust implementation significantly improves our codebase by allowing us to remove complex logic from the UI, which will lead to better performance and easier maintenance. I particularly appreciate the elegant structure you've used - it really showcases Rust's strengths compared to our previous JavaScript implementation.

I've left some inline comments regarding the documentation of individual APIs and some aspects of the logic. The main point I would like to emphasize is ensuring that we align the logic here with what's used in the pallet logic. This consistency will help ensure that the output accurately reflects on-chain behavior

pallets/funding/Cargo.toml Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Outdated Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Show resolved Hide resolved
pallets/funding/src/runtime_api.rs Show resolved Hide resolved
@JuaniRios JuaniRios merged commit 79eaafd into main Jul 22, 2024
@JuaniRios JuaniRios deleted the 07-08-runtime_apis branch July 22, 2024 15:02
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