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

chore/VRF-325 - Added smoke test for direct funding on VRFv2 #11690

Merged
merged 5 commits into from
Jan 12, 2024

Conversation

dkneisly
Copy link
Contributor

@dkneisly dkneisly commented Jan 5, 2024

Added smoke tests for direct funding invoking randomness on VRFv2

@dkneisly dkneisly requested review from a team as code owners January 5, 2024 12:47
Copy link
Contributor

github-actions bot commented Jan 5, 2024

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@dkneisly dkneisly changed the title Added smoke test for direct funding on VRFv2 chore/VRF-325 - Added smoke test for direct funding on VRFv2 Jan 5, 2024
@dkneisly dkneisly force-pushed the chore/VRF-825-v2-direct-funding-test branch from 7a6b291 to afaec69 Compare January 10, 2024 08:13
@dkneisly dkneisly requested a review from iljapavlovs January 10, 2024 08:20
@@ -108,6 +108,7 @@ package gethwrappers
//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2Wrapper/VRFV2Wrapper.abi ../../contracts/solc/v0.8.6/VRFV2Wrapper/VRFV2Wrapper.bin VRFV2Wrapper vrfv2_wrapper
//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2WrapperInterface/VRFV2WrapperInterface.abi ../../contracts/solc/v0.8.6/VRFV2WrapperInterface/VRFV2WrapperInterface.bin VRFV2WrapperInterface vrfv2_wrapper_interface
//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample/VRFV2WrapperConsumerExample.abi ../../contracts/solc/v0.8.6/VRFV2WrapperConsumerExample/VRFV2WrapperConsumerExample.bin VRFV2WrapperConsumerExample vrfv2_wrapper_consumer_example
//go:generate go run ./generation/generate/wrap.go ../../contracts/solc/v0.8.6/VRFV2WrapperLoadTestConsumer/VRFV2WrapperLoadTestConsumer.abi ../../contracts/solc/v0.8.6/VRFV2WrapperLoadTestConsumer/VRFV2WrapperLoadTestConsumer.bin VRFV2WrapperLoadTestConsumer vrfv2_wrapper_load_test_consumer
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is everything commented out here? You uncomment and run a specific line only when you need it?

Copy link
Collaborator

@iljapavlovs iljapavlovs Jan 11, 2024

Choose a reason for hiding this comment

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

its just how it works, it should be commented out. check https://go.dev/blog/generate.

so //go:generate will be invoked when "go generate" cmd will be invoked from cli. Which in turn you need to invoke from make command - https://github.com/smartcontractkit/chainlink/blob/develop/contracts/GNUmakefile#L72C1-L72C1

So whenever you add a solidity contract or update it, you need to invoke make wrappers-all from contracts folder.

In case if you have added new contract, then afterwards you need to ensure that you have added the contracts' golang binding, in this case it's vrfv2_wrapper_load_test_consumer.go. you need to add it from git unversioned files

if err != nil {
return nil, nil, err
}
err = env.EVMClient.WaitForEvents()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to do assignment expressions in Go (assign the variable and check the condition in one line)? Or this is the standard way to do error handling in Go? Just curious if anyone knows... I have very little knowledge of Go.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess it would look smth like this:

	if err := env.EVMClient.WaitForEvents(); err != nil {
		return nil, nil, fmt.Errorf("%s, err %w", ErrWaitTXsComplete, err)
	}

but its matter of preference

@dkneisly dkneisly enabled auto-merge January 12, 2024 00:44
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dkneisly dkneisly added this pull request to the merge queue Jan 12, 2024
Merged via the queue into develop with commit c0f9838 Jan 12, 2024
92 checks passed
@dkneisly dkneisly deleted the chore/VRF-825-v2-direct-funding-test branch January 12, 2024 01:42
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