Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

@Tofel
Copy link
Contributor

@Tofel Tofel commented May 13, 2024

  • it will be cleaner to access root PK via MustGetRootPrivateKey() than via client.PrivateKeys[0]
  • updated README.md
  • do not require to pass root key, when estimating gas
  • new keyfile settings added to TOML config
  • keyfile env var is now used only in CLI
  • keyfile content can be read from env in base64 form (useful in CI)
  • if epehemeral_address_number key is missing from TOML config we will default to 0 instead of 60
  • tests for parts of config validation
  • check length of URL slice before accessing it via index to avoid index out of bonds
  • estimate gas price, when splitting funds instead of always using hardcoded value
  • print ready-to-copy-to-TOML gas estimations info
  • couple of NPE fixes

@Tofel Tofel requested a review from skudasov May 13, 2024 06:49
@Tofel Tofel changed the title add two helpers that return root private key new helpers + various streamlines May 15, 2024
@Tofel Tofel changed the title new helpers + various streamlines [TT-1148] new helpers + various streamlines May 15, 2024
Tofel added 2 commits May 15, 2024 10:17
# This is the 1st commit message:

print also gas estimation/key split result that's TOML-ready

# This is the commit message #2:

read keyfile from base64-ed env var or file

# This is the commit message #3:

fix couple of nil pointers, generate address to satisfy validations when estimating gas, read keyfile either from base64-ed env var or file

# This is the commit message #4:

fix npe, read root buffer from cmd line, zero ephemeral addresses by default

# This is the commit message #5:

fix tests, const with keyfile env var

# This is the commit message #6:

split fund returns and keyfile update
@Tofel Tofel force-pushed the f_two_convienence_methods branch from 33d10c7 to c31b9be Compare May 15, 2024 08:18
skudasov
skudasov previously approved these changes May 15, 2024
case "gas":
var cfg *seth.Config
var pk string
_, pk, err = seth.NewAddress()
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll clean up this later as agreed. Need to refactor key handling and client struct

}
bd, err := c.CalculateSubKeyFunding(10, gasPrice.Int64(), 10)
require.NoError(t, err, "Error calculating subkey funding")
err = sethcmd.RunCLI([]string{"seth", "-n", os.Getenv("NETWORK"), "keys", "split", "-a", "10", "-b", "10"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add docs about -b root key buffer?

@Tofel Tofel merged commit 3349637 into master May 15, 2024
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