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

Initial signature aggregator unit tests #457

Merged
merged 7 commits into from
Aug 30, 2024
Merged

Initial signature aggregator unit tests #457

merged 7 commits into from
Aug 30, 2024

Conversation

feuGeneA
Copy link
Contributor

@feuGeneA feuGeneA commented Aug 22, 2024

Why this should be merged

it's a first step towards fixing #446

@feuGeneA feuGeneA changed the title Signature aggregator unit tests Initial signature aggregator unit tests Aug 22, 2024
@feuGeneA feuGeneA marked this pull request as ready for review August 22, 2024 23:01
@feuGeneA feuGeneA requested a review from a team as a code owner August 22, 2024 23:01
@@ -343,6 +343,8 @@ func (s *SignatureAggregator) CreateSignedMessage(
return nil, errNotEnoughSignatures
}

// TODO: consider making this function private. its only reference seems to be
Copy link
Contributor

Choose a reason for hiding this comment

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

Yup both of the below should be private. That was my oversight in the move

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in e5d44b4

@feuGeneA feuGeneA requested a review from iansuvak August 23, 2024 18:05
@@ -1,6 +1,8 @@
// Copyright (C) 2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

//go:generate mockgen -source=$GOFILE -destination=./mocks/mock_app_request_network.go -package=mocks

Choose a reason for hiding this comment

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

why is this included in the source file? I would expect the source file to not need to have knowledge of the mock file at all. Instead, can the mock file keep track of command needed to regenerate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's here because the mock is generated from this source file, which is represented on this line by $GOFILE. btw i took this from your example 😅 at https://github.com/ava-labs/awm-relayer/pull/21/files#diff-b7c4d6477bfb555408745965840c387dcfc91a74bcbdc3b30d31d594e9abc0e5R4

my understanding is that the mock source file is 100% generated so we can't really put anything in there.

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

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

Generally LGTM but I do prefer Mock Checker that @minghinmatthewlam suggested as the name visible on the UI rather than the more verbose one, it also follows the pattern of ABI Go Bindings Checker.

scripts/build.sh Outdated
# Root directory
root=$(
cd "$(dirname "${BASH_SOURCE[0]}")"
cd .. && pwd
)

"$root"/scripts/generate.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer this not being included in the build script to make it run faster if iterating on some manual testing. That being said in that case you would probably be running a specific build script as well so feel free to drop if you disagree

Co-authored-by: minghinmatthewlam <matthew.lam@avalabs.org>
Signed-off-by: F. Eugene Aumson <feuGeneA@users.noreply.github.com>
feuGeneA added a commit that referenced this pull request Aug 30, 2024
addresses review comment #457 (comment)
feuGeneA added a commit that referenced this pull request Aug 30, 2024
feuGeneA added a commit that referenced this pull request Aug 30, 2024
addresses review comment #457 (comment)
@feuGeneA feuGeneA requested a review from iansuvak August 30, 2024 14:48

go build -o tests/cmd/decider/decider ./tests/cmd/decider/

"$root"/scripts/generate.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

I would still rather call this manually than have it be re-generated automatically ever. If it's quick it might not make too much of a difference. not a blocker though

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree. I wouldn't ever expect running a test to alter my git status

feuGeneA added a commit that referenced this pull request Aug 30, 2024
feuGeneA added a commit that referenced this pull request Aug 30, 2024
feuGeneA added a commit that referenced this pull request Aug 30, 2024
addresses review comment #457 (comment)
@feuGeneA feuGeneA merged commit ccc7a60 into main Aug 30, 2024
8 checks passed
@feuGeneA feuGeneA deleted the sig-agg-unit-tests branch August 30, 2024 19:06
feuGeneA added a commit that referenced this pull request Aug 30, 2024
addresses review comment #457 (comment)
feuGeneA added a commit that referenced this pull request Sep 5, 2024
addresses review comment #457 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants