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

Adding NewTxFromReader to handle large blocks #56

Merged
merged 3 commits into from
Sep 27, 2021
Merged

Adding NewTxFromReader to handle large blocks #56

merged 3 commits into from
Sep 27, 2021

Conversation

ordishs
Copy link
Collaborator

@ordishs ordishs commented Sep 27, 2021

I have also changed the original NewTxFromBytes() etc to wrap the byte slices with an bytes.NewReader() to be DRY'er.

tx_test.go Outdated
r := bufio.NewReader(f)

header := make([]byte, 80)
if n, err := io.ReadFull(f, header); n != 80 || err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

@ordishs can you change this to:

	var n int
	if n, err = io.ReadFull(f, header); n != 80 || err != nil {

because when running make test-ci it's causing the linter to fail here:

tx_test.go:175:8: shadow: declaration of "err" shadows declaration at line 163 (govet)
	if n, err := io.ReadFull(f, header); n != 80 || err != nil {
	      ^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@jadwahab jadwahab changed the title Adding NewTxFromReader to v1 stable branch. Adding NewTxFromReader to handle large blocks Sep 27, 2021
@jadwahab jadwahab merged commit 4c13db4 into libsv:v1 Sep 27, 2021
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.

2 participants