[#114] Add a command to generate a fresh address in nettest
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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.