Conversation
lrettig
reviewed
Aug 7, 2024
| if err != nil { | ||
| log.Fatalf("Error: required signatures %s for %s on line %d is invalid", requiredSignaturesStr, name, i) | ||
| } | ||
| requiredSignatures := uint8(requiredSignatures64) |
Contributor
There was a problem hiding this comment.
Can we combine this with the strconv and just read the number directly into u8?
lrettig
reviewed
Aug 7, 2024
| var processCSVCmd = &cobra.Command{ | ||
| Use: "csv", | ||
| Short: "Process a CSV file with account definitions " + | ||
| "(name, amount, key1, key2, key3, key4, key5, required_signatures)", |
Contributor
There was a problem hiding this comment.
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)"?
lrettig
reviewed
Aug 7, 2024
| } | ||
|
|
||
| // Write updated records to a new CSV file | ||
| outputFile, err := os.Create("updated_" + csvFilePath) |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSV columns should be:
Then running:
will output
updated_address_definitions.csvwith two additional columns: