-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Test VMC contract in golang #21
Test VMC contract in golang #21
Conversation
… geth-sharding
91ce8cd
to
e1e1c40
Compare
e1e1c40
to
aeee940
Compare
addr = crypto.PubkeyToAddress(key.PublicKey) | ||
) | ||
|
||
func TestContractCreation(t *testing.T) { |
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.
Can you be more specific? This is testing a lot of things other than just deploying the contract.
Please split up these into smaller tests where each test method has a suite of test conditions and expected output.
accountBalance, _ := new(big.Int).SetString("1000000000000000000000", 10) | ||
contractBackend := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: accountBalance}}) | ||
transactOpts := bind.NewKeyedTransactor(key) | ||
callOpts := bind.CallOpts{} |
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.
This can be inline on line 33
contractBackend := backends.NewSimulatedBackend(core.GenesisAlloc{addr: {Balance: accountBalance}}) | ||
transactOpts := bind.NewKeyedTransactor(key) | ||
callOpts := bind.CallOpts{} | ||
filterOpts := bind.FilterOpts{} |
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.
This can be inline on line 47
if depositsIterator.Event.Index.Cmp(big.NewInt(0)) != 0 { | ||
t.Fatalf("Validator index mismatch: %d should be 0", depositsIterator.Event.Index) | ||
} | ||
fmt.Printf("%x\n", depositsIterator.Event.Validator) |
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.
No need for this print statement
Known issue: Test failing until upstream merges fix with abigen
… into geth-sharding
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.
Travis seems flaky so I think we can ignore it for now.
Test VMC contract in golang
Test VMC contract in golang Former-commit-id: f0ede01
EIP-4844 Blobs sidecar API endpoint (rebased)
Co-authored-by: Mário Havel <61149543+taxmeifyoucan@users.noreply.github.com>
Unpacked arguments for the CollationAdded event
New VMC go bindings