Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Add script to generate DAI for given testchain address #192

Merged
merged 3 commits into from
Dec 10, 2019

Conversation

grandizzy
Copy link

usage: > node_modules/.bin/babel-node scripts/generateDai.js

usage: > node_modules/.bin/babel-node scripts/generateDai.js <address> <daiAmount>
@levity
Copy link
Contributor

levity commented Dec 5, 2019

Maybe this script should live somewhere else? It seems to be very specific to some use case, e.g. it not only generates Dai for an address but sets the price and debt ceiling for the entire testchain and removes the allowance for the address.

@@ -0,0 +1,45 @@
// usage:
// > node_modules/.bin/babel-node scripts/fundTestAccount.js <address>
Copy link
Contributor

Choose a reason for hiding this comment

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

update usage comment

Copy link
Author

Choose a reason for hiding this comment

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

done

// usage:
// > node_modules/.bin/babel-node scripts/fundTestAccount.js <address>

import Maker from '../packages/dai/src';
Copy link
Contributor

@levity levity Dec 5, 2019

Choose a reason for hiding this comment

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

please use absolute imports, i.e. @makerdao/dai; once you run the repo setup (docs) they will use the local builds anyway

Copy link
Author

Choose a reason for hiding this comment

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

done

- updated usage command
- cleaned up script to only generate MDAI
- use absolute imports
- print account MDAI balance after generating MDAI
@grandizzy
Copy link
Author

Maybe this script should live somewhere else? It seems to be very specific to some use case, e.g. it not only generates Dai for an address but sets the price and debt ceiling for the entire testchain and removes the allowance for the address.

Oops, I clean out script to leave only part for generating DAI

@grandizzy grandizzy requested a review from levity December 6, 2019 10:31
@levity
Copy link
Contributor

levity commented Dec 9, 2019

Maybe this script should live somewhere else? It seems to be very specific to some use case, e.g. it not only generates Dai for an address but sets the price and debt ceiling for the entire testchain and removes the allowance for the address.

Oops, I clean out script to leave only part for generating DAI

Let's move this into the test-helpers package since it's only for the testchain. You can create packages/test-helpers/scripts and put it in there

@grandizzy
Copy link
Author

Maybe this script should live somewhere else? It seems to be very specific to some use case, e.g. it not only generates Dai for an address but sets the price and debt ceiling for the entire testchain and removes the allowance for the address.

Oops, I clean out script to leave only part for generating DAI

Let's move this into the test-helpers package since it's only for the testchain. You can create packages/test-helpers/scripts and put it in there

Done with last commit. Following this structure - shouldn't fundTestAccount.js be moved in same place as generateDai.js? Thanks

@levity
Copy link
Contributor

levity commented Dec 10, 2019

Yes, quite right. I'll take care of that

@levity levity merged commit fca5e17 into makerdao:dev Dec 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants