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

Deal validation tests #407

Merged
merged 6 commits into from
Apr 5, 2022
Merged

Deal validation tests #407

merged 6 commits into from
Apr 5, 2022

Conversation

aarshkshah1992
Copy link
Collaborator

Closes #216.

@aarshkshah1992 aarshkshah1992 requested a review from dirkmc April 5, 2022 08:02
Comment on lines 87 to 93

// deal fails because signature is invalid
res, err = f.makeDummyDeal(dealUuid, carFilepath, rootCid, server.URL+"/"+filepath.Base(carFilepath), false, abi.NewTokenAmount(2000000), withInvalidSignature())
require.NoError(t, err)
require.False(t, res.Accepted)
require.Contains(t, res.Reason, "error verifying signature")
log.Debugw("got response from MarketDummyDeal", "res", spew.Sdump(res))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't really need the invalid signature and min ask tests at the dummy deal level if we're already testing these things in the provider unit test

Copy link
Collaborator Author

@aarshkshah1992 aarshkshah1992 Apr 5, 2022

Choose a reason for hiding this comment

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

@dirkmc Dosen't hurt to have it for a sanity check as these are two important validations and these finish quickly as we don't wait for these deals to be sealed since they get rejected right off the bat.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd rather keep all the validation testing in one place. Someone looking at this code later might think they should add validation testing code here. In general I favour having the minimal amount of tests to keep the code maintainable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, done.

@aarshkshah1992 aarshkshah1992 merged commit 2143075 into main Apr 5, 2022
@aarshkshah1992 aarshkshah1992 deleted the feat/deal-acceptance-tests branch April 5, 2022 10:58
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.

Refactor deal validation code so it's testable and write deal validation unit tests
2 participants