-
Notifications
You must be signed in to change notification settings - Fork 12
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
Accept a CSV with account definitions as input and fill in vesting and vault addresses #122
base: develop
Are you sure you want to change the base?
Conversation
if err != nil { | ||
log.Fatalf("Error: required signatures %s for %s on line %d is invalid", requiredSignaturesStr, name, i) | ||
} | ||
requiredSignatures := uint8(requiredSignatures64) |
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.
Can we combine this with the strconv
and just read the number directly into u8?
var processCSVCmd = &cobra.Command{ | ||
Use: "csv", | ||
Short: "Process a CSV file with account definitions " + | ||
"(name, amount, key1, key2, key3, key4, key5, required_signatures)", |
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.
IIRC we actually support up to ten keys, although in practice I don't think anyone is using that many. Maybe worth adding to the description something like "(for an account with up to five pubkeys)"?
} | ||
|
||
// Write updated records to a new CSV file | ||
outputFile, err := os.Create("updated_" + csvFilePath) |
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.
This is a little counterintuitive, I'm not sure the user will know where to find this file. I think printing to STDOUT would make more sense, then they can use shell redirect if they want to save to a new file.
CSV columns should be:
Then running:
will output
updated_address_definitions.csv
with two additional columns: