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

Chore: remove a redundant argument to maintain single source of truth #5530

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

jannotti
Copy link
Contributor

@jannotti jannotti commented Jul 7, 2023

This eliminates an initial *SIgnedTransaction argument that is redundant with the later combination of group index and groupCtx argument. That way, callers can't mess it up.

@jannotti jannotti changed the title Chore: remove a redundant argument to matin signle source of truth Chore: remove a redundant argument to maintain single source of truth Jul 7, 2023
@jannotti jannotti self-assigned this Jul 7, 2023
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Merging #5530 (3948b65) into master (3e80027) will increase coverage by 0.08%.
The diff coverage is 65.62%.

@@            Coverage Diff             @@
##           master    #5530      +/-   ##
==========================================
+ Coverage   55.78%   55.87%   +0.08%     
==========================================
  Files         446      446              
  Lines       63262    63263       +1     
==========================================
+ Hits        35293    35350      +57     
+ Misses      25590    25547      -43     
+ Partials     2379     2366      -13     
Impacted Files Coverage Δ
cmd/goal/clerk.go 8.88% <0.00%> (ø)
data/transactions/verify/txn.go 56.65% <80.76%> (+0.92%) ⬆️

... and 17 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jannotti jannotti marked this pull request as ready for review July 7, 2023 17:07
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Looks great!
Just one curious question.

if groupCtx.consensusParams.LogicSigVersion == 0 {
return errors.New("LogicSig not enabled")
}

if gi < 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you care to check for negative values, and not for values greater than the group size?

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 just retained the existing check (pulled up from lines 356-358, because I needed to use the index earlier).

I think maybe the negative check is a bit too much paranoia, but didn't want to make a decision like that in this PR. In all the cases I know of, these gi indexes come from a range operator on the transactions, so I probably would not check less than zero or greater than length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants