Skip to content
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

[PVM] replace nil-signers Sign with Initialize, make syncGenesis private #370

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

evlekht
Copy link
Member

@evlekht evlekht commented Aug 1, 2024

Why this should be merged

CaminoState.SyncGenesis is only called from the same package, exactly as intended, so there is no need to export this method.

txs.NewSigned calls txs.Sign. If nil signers arg is passed, than Sign method results only in setting signedTx bytes and unsignedTx bytes to tx fields, no actual signing is performed, though it still does things like calculating unsigned tx hash for signing purposes. There is no need in it. Replace all those calls with tx.Initialize which does same bytes initialization (as done in some of avax methods).

How this works

CaminoState.SyncGenesis -> CaminoState.syncGenesis
txs.NewSigned(txs.Codec, nil) -> txs.Initialize(txs.Codec)

How this was tested

Existing unit and e2e tests.

Additional references

Original PR based on cortina-15 dev
#345

@evlekht evlekht changed the title Dev c0/small cleanup [PVM] replace nil-signers Sign with Initialize, make syncGenesis private Aug 2, 2024
@evlekht evlekht force-pushed the dev-c0/small-cleanup branch from 74cae09 to 3357e14 Compare August 2, 2024 16:07
mo-c4t
mo-c4t previously approved these changes Aug 5, 2024
Noctunus
Noctunus previously approved these changes Aug 5, 2024
@evlekht evlekht force-pushed the dev-c0/small-cleanup branch from 3357e14 to f6a97d9 Compare August 7, 2024 12:55
@evlekht evlekht changed the base branch from dev-c0/base to dev August 7, 2024 12:55
@evlekht evlekht dismissed stale reviews from Noctunus and mo-c4t August 7, 2024 12:55

The base branch was changed.

@evlekht evlekht marked this pull request as ready for review August 7, 2024 12:56
@evlekht evlekht merged commit ca20975 into dev Aug 7, 2024
@evlekht evlekht deleted the dev-c0/small-cleanup branch August 7, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants