-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feat/external txs #328
Feat/external txs #328
Conversation
merge master of aragon/aragon.js
Hey! You'll notice I added a |
It'd be awesome if we could interact with contracts that aren't registered as a DAO's app contracts. The primary use case for this right now is interacting with StandardBounties.sol, Users of the current Rinkeby Projects app deployment need to relay their calls through the projects contract when submitting work to fulfill bounties. This adds what would otherwise be unnecessary expense, and isn't the cleanest way to go about this. |
@topocount let me know if this is not working for you, and if so, what the error message is. @sohkai - removed the |
@topocount Agreed, @Schwartz10 and I discussed this yesterday about using the transaction pathing only if the transaction is to an installed app. Otherwise it'll be treated as a "direct" transaction. |
@sohkai @2color ready for your review! One thing to note is that the transaction path contains a transaction object that now has 2 additional fields:
Figured it's probably useful to give this information in the client, but I couldn't figure out a better way to display that information. This is what the tests I added are essentially checking for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇 Sorry for taking a while to look at these!
This looks generally good, but I have a couple suggestions to make it a bit more succinct :). I can also make the changes in the next few days if you'd like!
packages/aragon-wrapper/src/index.js
Outdated
* @param {Array<*>} params | ||
* @return {Promise<Array<Object>>} An array of a single Ethereum direct transaction | ||
*/ | ||
async getUninstalledAppTransactionPath (destination, method, params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having two functions, we could probably just combine this with getTransactionPath()
and handle it as a case where the destination
is not an installed app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sohkai - originally I tried to approach external tx pathing this way, but what's the best strategy to handle the ABI of the external method without breaking things?
One approach is to include an optional methodAbi param:
async getTransactionPath (destination, methodName, params, finalForwarder, methodAbi = []) { ... }
Another way that feels prettier, but also like a much bigger change, is to adjust the getTransactionPath
method to take method
(includes the abi) rather than just the methodName
, and then grab the name from the method
object. This is pretty much exactly what getUninstalledAppTransactionPath
does: method is used as abi & using method.name as methodName
Although more concise, this strategy feels like its changes could propagate to other parts of aragon.js and potentially break things.
Am i missing something? or is there another strategy you like better that I didn't think of?
Thanks for the feedback @sohkai ! My goal is to wrap this up tomorrow (Friday). |
@sohkai i'm confident these changes will work, but i want to test them in some real code on monday. Feel free to review whenever is convenient for you, and I'll leave a comment here once I've tested thoroughly |
@sohkai this is all set - tested with both installed, external contracts, and uninstall external contracts. |
…ernalTransactionPath()
@Schwartz10 I've just added a few commits with mostly clarifications / small cleanups I saw. The big important one is 0efdaa4, where I've restructured a few of the internal plumbing. The only external API change is how We still need to rework the external tests a bit. Here's what I'm thinking:
It would be great if you could review and retest these changes! |
@Schwartz10 I've pushed the final changes for the tests, including a bug fix in 31a6236 on my previous pushes. It also changes the language around the "JSON interface". web3.js likes to use It would be greatly appreciated if you could re-test, and we can get this merged! |
@sohkai just re-tested with external installed, and external uninstalled. Both working properly. Let's pull this in asap! Once that's all set, I'll work on finishing up aragon/client#850 |
…performTransactionPath()
Changes
If you are modifying the external API of one of the modules, please remember to also change the documentation
Fixes #120