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

Dedupe secp256k1 key usage in tests #2511

Merged
merged 4 commits into from
Dec 19, 2023
Merged

Conversation

dhrubabasu
Copy link
Contributor

@dhrubabasu dhrubabasu commented Dec 19, 2023

Why this should be merged

De-dupes code

How this works

use existing secp256k1.TestKeys() helper function: https://github.com/ava-labs/avalanchego/blob/dev/utils/crypto/secp256k1/test_keys.go

How this was tested

CI

@dhrubabasu dhrubabasu added testing This primarily focuses on testing cleanup Code quality improvement labels Dec 19, 2023
@dhrubabasu dhrubabasu added this to the v1.10.18 milestone Dec 19, 2023
@dhrubabasu dhrubabasu self-assigned this Dec 19, 2023
@@ -70,22 +69,16 @@ var (
chainID = ids.ID{5, 4, 3, 2, 1}
assetID = ids.ID{1, 2, 3}

keys []*secp256k1.PrivateKey
keys = secp256k1.TestKeys()[:3]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this but a lot of the avm tests rely on this being size 3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a TODO

Copy link
Contributor

@joshua-kim joshua-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we use hard-coded test keys/having this test function instead of just generating new ones with NewPrivateKey

@StephenButtolph StephenButtolph added this pull request to the merge queue Dec 19, 2023
Merged via the queue into dev with commit 58d2779 Dec 19, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the dedupe-secp256k1-keys branch December 19, 2023 19:14
joshua-kim added a commit that referenced this pull request Dec 19, 2023
commit 7a0dfda
Author: Joshua Kim <[email protected]>
Date:   Tue Dec 12 03:29:47 2023 -0500

    testing structs

    Signed-off-by: Joshua Kim <[email protected]>

commit 58d2779
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 14:01:16 2023 -0500

    Dedupe secp256k1 key usage in tests (#2511)

commit 6c64372
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 11:45:58 2023 -0500

    Remove unused `AcceptorTracker` struct (#2508)

commit 7a9bdad
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 10:44:20 2023 -0500

    Remove unused `BuildGenesisTest` function (#2503)

commit 44d71db
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Dec 18 19:05:26 2023 -0500

    Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#2502)

    Signed-off-by: dependabot[bot] <[email protected]>
    Signed-off-by: Stephen Buttolph <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Stephen Buttolph <[email protected]>

commit aa764bb
Author: Alberto Benegiamo <[email protected]>
Date:   Mon Dec 18 16:00:17 2023 -0700

    Drop Pending Stakers 5 - validated PostDurango StakerTxs (#2314)

    Co-authored-by: Stephen Buttolph <[email protected]>
    Co-authored-by: dhrubabasu <[email protected]>

Signed-off-by: Joshua Kim <[email protected]>
joshua-kim added a commit that referenced this pull request Dec 19, 2023
commit 7a0dfda
Author: Joshua Kim <[email protected]>
Date:   Tue Dec 12 03:29:47 2023 -0500

    testing structs

    Signed-off-by: Joshua Kim <[email protected]>

commit 58d2779
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 14:01:16 2023 -0500

    Dedupe secp256k1 key usage in tests (#2511)

commit 6c64372
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 11:45:58 2023 -0500

    Remove unused `AcceptorTracker` struct (#2508)

commit 7a9bdad
Author: Dhruba Basu <[email protected]>
Date:   Tue Dec 19 10:44:20 2023 -0500

    Remove unused `BuildGenesisTest` function (#2503)

commit 44d71db
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Dec 18 19:05:26 2023 -0500

    Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#2502)

    Signed-off-by: dependabot[bot] <[email protected]>
    Signed-off-by: Stephen Buttolph <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Stephen Buttolph <[email protected]>

commit aa764bb
Author: Alberto Benegiamo <[email protected]>
Date:   Mon Dec 18 16:00:17 2023 -0700

    Drop Pending Stakers 5 - validated PostDurango StakerTxs (#2314)

    Co-authored-by: Stephen Buttolph <[email protected]>
    Co-authored-by: dhrubabasu <[email protected]>

Signed-off-by: Joshua Kim <[email protected]>
tedim52 pushed a commit to tedim52/avalanchego that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code quality improvement testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants