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

Add tests for verifyTx and verifyHeader #1318

Merged
merged 4 commits into from
Aug 14, 2020
Merged

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Aug 13, 2020

Close #1305 .
Related #1292 .

@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #1318 into master will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1318      +/-   ##
==========================================
+ Coverage   68.07%   68.25%   +0.17%     
==========================================
  Files         215      215              
  Lines       18508    18524      +16     
==========================================
+ Hits        12599    12643      +44     
+ Misses       5227     5212      -15     
+ Partials      682      669      -13     
Impacted Files Coverage Δ
pkg/smartcontract/manifest/manifest.go 91.02% <ø> (ø)
pkg/core/blockchain.go 71.32% <100.00%> (+3.63%) ⬆️
pkg/core/native/policy.go 73.35% <0.00%> (+0.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95d86b6...cadebdf. Read the comment docs.

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

verifyTxWitnesses and verifyHashAgainstScript remain.

pkg/core/blockchain.go Outdated Show resolved Hide resolved
pkg/core/blockchain_test.go Outdated Show resolved Hide resolved
pkg/core/blockchain_test.go Outdated Show resolved Hide resolved
pkg/core/blockchain.go Outdated Show resolved Hide resolved
return ErrWitnessHashMismatch
}
} else {
cs, err := interopCtx.DAO.GetContractState(hash)
Copy link
Member

Choose a reason for hiding this comment

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

It's a separate non-preview3-compatible feature, it shouldn't be a part of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure? It was 4 months ago neo-project/neo#1481

Copy link
Member

Choose a reason for hiding this comment

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

Let me check, I was thinking more of neo-project/neo#1800.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this part is really preview3, but it should substitute ScriptFromWitness() then.

Copy link
Contributor Author

@fyrchik fyrchik Aug 14, 2020

Choose a reason for hiding this comment

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

ScriptFromWitness has no necessary context, and its signature will become not so understandable.
I am thinking about making verifyHashAgainstScript public.

Copy link
Member

Choose a reason for hiding this comment

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

That's a good option too, simplifying consensus a bit along the way.

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'd postpone it until after release, as it requires some refactoring of both core and consensus to do right.

@roman-khimov roman-khimov merged commit 8e619cc into master Aug 14, 2020
@roman-khimov roman-khimov deleted the fix/verifytests branch August 14, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more tests for header and transaction verification
2 participants