Skip to content

Conversation

@noamnelke
Copy link
Member

CSV columns should be:

name, amount, key1, key2, key3, key4, key5, required_signatures

Then running:

./smcli genesis csv --file address_definitions.csv

will output updated_address_definitions.csv with two additional columns:

vesting_address, vault_address

@noamnelke noamnelke requested a review from lrettig August 6, 2024 14:04
if err != nil {
log.Fatalf("Error: required signatures %s for %s on line %d is invalid", requiredSignaturesStr, name, i)
}
requiredSignatures := uint8(requiredSignatures64)
Copy link
Contributor

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)",
Copy link
Contributor

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)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants