Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Closes AP-752,AP-779: Use cli types in tasks #392

Merged
merged 23 commits into from
Sep 27, 2023

Conversation

0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Sep 25, 2023

Explanation of the solution

Instructions on making this work

  • run yarn or yarn install to install npm dependencies

@0xNeshi 0xNeshi added bug Something isn't working enhancement New feature or request labels Sep 25, 2023
@0xNeshi 0xNeshi self-assigned this Sep 25, 2023
@@ -5,7 +5,7 @@ import {getAddresses, getSigners, logger, structToObject} from "utils";
type TaskArgs = {id: number};

task("manage:queryEndowments", "Will query an Endowment's details")
.addParam("id", "the endowment id", 0, types.int)
.addParam("id", "the endowment id", undefined, types.int)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to query for non-existent endow IDs


type TaskArgs = {
appsSignerPkey?: string;
endowType: 0 | 1;
endowType: EndowmentType;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at this task's logic, it seems with this small type change it finally fully supports creating DAFs too
(see Linear issue https://linear.app/angel-protocol/issue/AP-752/add-support-for-creating-dafs-in-managecreateendowment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! 😎

@0xNeshi 0xNeshi changed the title AP-779: Use cli types in tasks Closes AP-752,AP-779: Use cli types in tasks Sep 25, 2023
@linear
Copy link

linear bot commented Sep 25, 2023

AP-779 Create custom task argument types (where applicable)

An example would be manage:registrar:setFeeSettings > feeType which should be "castable" to enum FeeTypes.

Use /tasks/types.ts as inspiration

AP-752 Add support for creating DAFs in `manage:createEndowment`

.addParam(
"gas",
"Qty of tokens fwd'd to pay for gas. Make sure to use the correct number of decimals!",
0,
undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes us be explicit about the value we use

@@ -16,98 +17,37 @@ type TaskArgs = Partial<RegistrarMessages.UpdateConfigRequestStruct> & {
yes: boolean;
};

// TODO: update param descriptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated param descriptions

} catch (error) {
logger.out(error, logger.Level.Error);
if (taskArgs.acceptedTokens.length === 0) {
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reduce nesting

@@ -14,7 +14,6 @@ import {
} from "utils";

type TaskArgs = {
factory?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't think of a situation where we'd be deploying a new EndowmentMultiSigFactory without storing its address in contract-address.json and then using this new contract in for this task.
In other words, we'd be reading the appropriate address from the address file in (almost?) all cases (as is the assumption in other tasks)

@SovereignAndrey SovereignAndrey merged commit ceb24e1 into master Sep 27, 2023
1 check passed
@SovereignAndrey SovereignAndrey deleted the use-cli-types-in-tasks branch September 27, 2023 04:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants