-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Common Test Boilerplate out of Morpheus VM #1664
Open
samliok
wants to merge
6
commits into
main
Choose a base branch
from
boilerplate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samliok
commented
Oct 15, 2024
Comment on lines
35
to
60
var ( | ||
_ workload.TxWorkloadFactory = (*workloadFactory)(nil) | ||
_ workload.TxWorkloadIterator = (*simpleTxWorkload)(nil) | ||
ed25519HexKeys = []string{ | ||
"323b1d8f4eed5f0da9da93071b034f2dce9d2d22692c172f3cb252a64ddfafd01b057de320297c29ad0c1f589ea216869cf1938d88c9fbd70d6748323dbf2fa7", //nolint:lll | ||
"8a7be2e0c9a2d09ac2861c34326d6fe5a461d920ba9c2b345ae28e603d517df148735063f8d5d8ba79ea4668358943e5c80bc09e9b2b9a15b5b15db6c1862e88", //nolint:lll | ||
} | ||
ed25519PrivKeys = make([]ed25519.PrivateKey, len(ed25519HexKeys)) | ||
ed25519Addrs = make([]codec.Address, len(ed25519HexKeys)) | ||
ed25519AuthFactories = make([]*auth.ED25519Factory, len(ed25519HexKeys)) | ||
) | ||
|
||
func init() { | ||
for i, keyHex := range ed25519HexKeys { | ||
privBytes, err := codec.LoadHex(keyHex, ed25519.PrivateKeyLen) | ||
if err != nil { | ||
panic(err) | ||
} | ||
priv := ed25519.PrivateKey(privBytes) | ||
ed25519PrivKeys[i] = priv | ||
ed25519AuthFactories[i] = auth.NewED25519Factory(priv) | ||
addr := auth.NewED25519Address(priv.PublicKey()) | ||
ed25519Addrs[i] = addr | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing this and the genesis configuration is an improvement imo. VM developers are probably going to be fine with these defaults, and if not we can expose a way for them to customize.
Still some more work to be done cleaning up the workloadfactory
or removing it all together.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Started writing e2e tests for the updated
vmwithcontracts
and noticed a bunch of common boilerplate code that should be separated out. I think this will also help make things clear for the larger e2e test refactorPR also removes the tests package from
vmwithcontracts
since its the same as morpheus vm