Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Add Validate Function #60

Merged
merged 1 commit into from
Oct 16, 2019
Merged

Add Validate Function #60

merged 1 commit into from
Oct 16, 2019

Conversation

ErinHales
Copy link
Contributor

@ErinHales ErinHales commented Oct 4, 2019

No description provided.

golang/btcspv/types.go Outdated Show resolved Hide resolved
golang/btcspv/types.go Outdated Show resolved Hide resolved
golang/btcspv/validate_spv.go Outdated Show resolved Hide resolved
golang/btcspv/validate_spv.go Outdated Show resolved Hide resolved
golang/btcspv/validate_spv.go Outdated Show resolved Hide resolved
golang/btcspv/validate_spv.go Outdated Show resolved Hide resolved
golang/btcspv/validate_spv.go Show resolved Hide resolved
@prestwich
Copy link
Member

A bunch of things are resolved, is there an unpushed commit?

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

Last to do item:
Tests for Validate() for both structs

golang/btcspv/validate_spv.go Show resolved Hide resolved
golang/btcspv/validate_spv.go Show resolved Hide resolved
@ErinHales
Copy link
Contributor Author

@prestwich Tests are finished, but the CalculateTxID in Validate for the SPV Proof is failing. I think the data in testProofs.json may be wrong, could you check that out? "{\"version\": \"0x01000000\",\"vin\": \"0x0101748906a5c7064550a594c4683ffc6d1ee25292b638c4328bb66403cfceb58a000000006a4730440220364301a77ee7ae34fa71768941a2aad5bd1fa8d3e30d4ce6424d8752e83f2c1b02203c9f8aafced701f59ffb7c151ff2523f3ed1586d29b674efb489e803e9bf93050121029b3008c0fa147fd9db5146e42b27eb0a77389497713d3aad083313d1b1b05ec0ffffffff\", \"vout\": \"0x0116312f00000000001976a91400cc8d95d6835252e0d95eb03b11691a21a7bac588ac\",\"locktime\": \"0x00000000\",\"tx_id\": \"0x74d6d6dc1fc9b0f393abde12e76adeeb3d674b38b7fbea4d9fc28b3bb0f67651\"

@prestwich
Copy link
Member

Now just need to add tests for the error cases :)

@ErinHales ErinHales changed the title WIP: Add Validate Function Add Validate Function Oct 12, 2019
resolved some type issues

organized Validate and cleaned up code/errors

finished Validate function for BitcoinHeader

added ConfirmingHeader.Validate() call

added documentation comments for validate functions

finished testing functions, think data may be wrong

tests: fix invalid proof in test vector

mostly finished testing

fixed for loops

removed todos

validate-function

Restructure data (#67)

* restructured data, all tests passing

* deleted commented sections

* simplified code

* reverted back, didn't work

* refactor: remove extra unmarshal step from tests

* bug: nbsps in error messages somehow? bizarre.

bug: vouts were not always 0x prefixed in proof tests (#68)

* bug: vouts were not always 0x prefixed in proof tests

* bug: remove debug print

added valid proof with invalid header test case
@prestwich prestwich merged commit 820ba9f into master Oct 16, 2019
@prestwich prestwich deleted the validate-function branch October 22, 2019 00:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants