Open bryanchriswhite opened 1 year ago
@bryanchriswhite Though it is not pre-generated, we do have runtime/test_artifacts/keygen/keygen.go
which enables determinstic keys:
func (k *keyGenerator) SetSeed(seed int) (teardown func()) {
k.privateKeySeed = seed
return func() {
k.reset()
}
}
func (k *keyGenerator) Next() (privateKey, publicKey, address string) {
k.privateKeySeed += 1 // Different on every call but deterministic
Do you think that's enough in terms of our testing utility to validate the need for this scope of work?
@Olshansk thanks for surfacing that! :raised_hands:
That should address the determinism aspect. The only other improvement I was anticipating would potentially be a speed improvement in CI (depending on "things" which I haven't looked into yet).
This issue was based on observations I made while debugging tests. It's definitely not urgent but I'm not sure how important it is (or could be, depending on "things").
I think the MVC here is to just go after the second delivarable. We already have ~1K keypairs in private-keys.yaml
which we could then use in unit tests.
Objective
Enabling faster and more deterministic tests.
Origin Document
Goals
testidentity
pkg)Deliverable
Add a make target which generates the keys, output as go source code.Load existing pre-generated keys from private-keys.yamltestkeys
; also see #609) which exports a means by which to retrieve the pre-generated ascryptoPocket.PrivateKey
sNon-goals / Non-deliverables
General issue deliverables
Testing Methodology
make test_all
LocalNet
is still functioning correctly by following the instructions at docs/development/README.mdCreator: @bryanchriswhite Co-Owners: @deblasis