Skip to content

[#114] Add a command to generate a fresh address in nettest

Ivan Gromakovskii requested to merge gromak/#114-nettest-fresh-addres into master

Description

Problem: in morley-nettest, we have newAddressAction. It generates a new secret key (and corresponding address) when no address with given name is known and does not mutate state otherwise. We do not overwrite existing secret key because it may have some funds and we don't want to lose them (even though it is testnet, getting XTZ takes some time and causes some inconvenience).

However, sometimes we want to generate a completely new address and be sure it has not been used before. For example, we may care about its balance and be sure that it's 0 initially.

Solution: add niGenFreshKey to NettestImpl and newFreshAddressAction. Client implementation first forgets the address if it is known and then calls gen keys command expecting it to always succeed (unlike niGenKey which tolerates a certain error). Pure implementation uses already saved address to construct the seed for the new address.

Note: in order to have a test it is desired to have #111 (closed) which will be done a bit later, hence the test is postponed.

Related issue(s)

Resolves #114 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it ← no, waiting for #111 (closed).
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Merge request reports