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

Field encapsulation #26

Merged
merged 10 commits into from
Jul 28, 2021
Merged

Field encapsulation #26

merged 10 commits into from
Jul 28, 2021

Conversation

theflyingcodr
Copy link
Contributor

This is making some key fields private and replacing the setting of them with other methods to reduce the scope of user error.

Added a few convenience methods in for getting output and input by index.

… if accessed directly by someone that doesn'tknow what they're doing. Added validation for adding PrevTXId and removed the bytes suffix. Adding some helpers for getting Outputs and Inputs as well as getting by index.
@codecov-commenter
Copy link

codecov-commenter commented May 10, 2021

Codecov Report

Merging #26 (e430698) into v2 (7358e36) will increase coverage by 0.15%.
The diff coverage is 83.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2      #26      +/-   ##
==========================================
+ Coverage   77.81%   77.97%   +0.15%     
==========================================
  Files          18       18              
  Lines        1073     1117      +44     
==========================================
+ Hits          835      871      +36     
- Misses        160      164       +4     
- Partials       78       82       +4     
Impacted Files Coverage Δ
signaturehash.go 84.00% <60.00%> (ø)
input.go 75.64% <66.66%> (-3.73%) ⬇️
bscript/bip276.go 79.31% <75.00%> (+5.39%) ⬆️
txinput.go 86.66% <77.77%> (-0.57%) ⬇️
tx.go 82.96% <88.63%> (+0.91%) ⬆️
bscript/addressvalidation.go 87.87% <100.00%> (-0.36%) ⬇️
bscript/script.go 60.00% <100.00%> (-0.44%) ⬇️
bscript/unlockingscript.go 100.00% <100.00%> (ø)
localsigner.go 62.50% <100.00%> (ø)
output.go 87.30% <100.00%> (ø)
... and 3 more

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 7358e36...e430698. Read the comment docs.

@theflyingcodr theflyingcodr marked this pull request as ready for review July 26, 2021 15:54
@theflyingcodr theflyingcodr self-assigned this Jul 26, 2021
localsigner.go Outdated Show resolved Hide resolved
input.go Show resolved Hide resolved
input.go Outdated Show resolved Hide resolved
tx.go Outdated Show resolved Hide resolved
tx_test.go Show resolved Hide resolved
txinput.go Outdated Show resolved Hide resolved
@jadwahab jadwahab merged commit 17eb7ba into v2 Jul 28, 2021
@jadwahab jadwahab deleted the field-encapsulation branch July 28, 2021 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants