-
Notifications
You must be signed in to change notification settings - Fork 53
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
Refactor API: ForwardingPath descriptions + App intent actions #256
Conversation
… refactor-transaction
Add a new method on the App entity to get the Intent for the methods of the app. Include ForwardingPath logic for the ACL.
Codecov Report
@@ Coverage Diff @@
## master #256 +/- ##
==========================================
- Coverage 19.89% 18.83% -1.07%
==========================================
Files 74 79 +5
Lines 1588 1731 +143
Branches 337 365 +28
==========================================
+ Hits 316 326 +10
- Misses 1272 1405 +133
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -117,4 +99,57 @@ export default class App { | |||
organization: null, | |||
} | |||
} | |||
|
|||
contract(): Contract { |
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.
Added two helpers to facilitate the interaction using Ethers Contract and Interface for the app.
readonly destination: AppOrAddress | ||
readonly transactions: Transaction[] | ||
|
||
constructor( |
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.
I finally decided to construct a ForwardingPath
with the list of Transactions
and the destination. This is relevant as the description of a forwarding path happened as a second step when we call describe()
method.
let description: StepDescribed[] = [] | ||
if (this.transactions.length > 0) { | ||
try { | ||
description = await describePath( |
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.
We first describe the current list of Transactions
getting a list of DescribedSteps
that include a description string and the annotated description. We use the DescribedStep
object to construct the ForwardingPathDescription
class that provides further data transformations (toString, tree, reduce).
* agreement: handle null signers * agreement: avoid single line if statement Co-authored-by: Pierre Bertet <[email protected]> Co-authored-by: Pierre Bertet <[email protected]>
* agreement: update staking ABI * agreement: fix test
* core: fix pre approvals * DisputableVoting: Fix pre approvals
* DisputableVoting: Implement voting checks * DisputableVoting: Make ethers provider dep explicit * DisputableVoting: Fix tests Co-authored-by: 0xGabi <[email protected]>
} | ||
|
||
get appName(): string { | ||
return this.artifact.appName | ||
async roles(): Promise<Role[]> { |
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.
Should we add a onRoles()
while we are at it?
@@ -113,7 +133,16 @@ export default class Organization { | |||
) | |||
} | |||
|
|||
async acl(): Promise<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.
I think it’s super nice yes! 👍
* DisputableVoting: Implement settlement offer * DisputableVoting: Improve settlement offer calc
This PR includes most of the changes discussed in #132
One of the most relevant changes from the spec is that we don't have an Intent object as it was an intermediary step that ends up adding more complexity to the code. Instead of giving an intent we calculate the path and then create a
ForwardingPath
object that provide extra functionality on top of the data: