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

Caching ABI in Action for future use #69

Merged
merged 6 commits into from
Aug 28, 2023
Merged

Conversation

aaroncox
Copy link
Member

@aaroncox aaroncox commented Jul 25, 2023

This is an idea to help the contract kit send transactions to the session kit...

The problem right now with the contract kit, when performing transactions, is you need to manually specify and pass in the ABIs to the session.transact call to prevent duplicate calls to retrieve the ABI.

The idea was that in situations where we have the ABI or a Struct, we can embed that into the Action class, which is what's passed into session.transact. If an ABI existed someplace like action.abi, then the Session Kit during the transct call would be able to do something like:

actions.forEach(action => {
  if (actions.abi) {
    // add ABI to ABI Cache
  }
})

Which would then prevent the session kit from needing to go out and fetch the ABI (since it's in the action already).

It's basically a trojan horse to pass along the ABI inside of the Action, for processes upstream that might be interacting with that Action.

This is probably a bad implementation, but it works, and submitted this as a draft to express the idea.

@aaroncox
Copy link
Member Author

This is related to: wharfkit/contract#29

The PR on the contract kit shows how we have to currently pass in the ABI to the transact call.

@aaroncox aaroncox marked this pull request as ready for review August 16, 2023 06:13
@aaroncox aaroncox changed the base branch from master to experimental August 28, 2023 19:35
@aaroncox aaroncox merged commit 3fb8f3f into experimental Aug 28, 2023
6 checks passed
This was referenced Aug 28, 2023
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.

1 participant