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

More tests for ContextExtension semantics #2104

Merged
merged 5 commits into from
Jan 29, 2024
Merged

More tests for ContextExtension semantics #2104

merged 5 commits into from
Jan 29, 2024

Conversation

kushti
Copy link
Member

@kushti kushti commented Jan 23, 2024

In this PR there are a couple of tests for validation of transactions with negative-id context extension variables

property("context extension with neg id") {
val negId: Byte = -1

ADKey @@ Base16.decode("c95c2ccf55e03cac6659f71ca4df832d28e2375569cec178dcb17f3e2e5f7742").get
Copy link
Member

Choose a reason for hiding this comment

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

This probably should be an explicit assertion.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

property("context extension with neg and pos ids") {
val negId: Byte = -20

ADKey @@ Base16.decode("c95c2ccf55e03cac6659f71ca4df832d28e2375569cec178dcb17f3e2e5f7742").get
Copy link
Member

Choose a reason for hiding this comment

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

This probably should be an explicit assertion.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

val txTry = defaultProver.sign(utx, IndexedSeq(b), IndexedSeq.empty, emptyStateContext)
.map(ErgoTransaction.apply)

txTry.isSuccess shouldBe false
Copy link
Member

Choose a reason for hiding this comment

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

I think it is better to test the exact reason of non-success.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@kushti kushti changed the base branch from master to v5.0.20 January 29, 2024 07:28
@kushti kushti merged commit 094a65d into v5.0.20 Jan 29, 2024
4 checks passed
@kushti kushti deleted the ce-tests branch January 29, 2024 08:11
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.

3 participants