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

Generating cis3 signatures in test case #359

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

DOBEN
Copy link
Member

@DOBEN DOBEN commented Nov 7, 2023

Purpose

Some of the test cases from cis3 haven't been migrated yet. Migrating some of them. In addition, add test cases that showcase how to generate account signatures within a test case (meaning how to create keypairs and how to use the signing function).

Changes

  • Add test case test_inside_signature_permit_transfer
  • Add test case test_outside_signature_permit_transfer
  • Add test case test_inside_signature_permit_update_operator
  • Add test case test_outside_signature_permit_update_operator

@DOBEN DOBEN force-pushed the generating-cis3-signatures-in-test-case branch from 25511ad to 0dc9149 Compare November 10, 2023 09:43
examples/cis3-nft-sponsored-txs/Cargo.toml Outdated Show resolved Hide resolved
examples/cis3-nft-sponsored-txs/src/lib.rs Show resolved Hide resolved
examples/cis3-nft-sponsored-txs/tests/tests.rs Outdated Show resolved Hide resolved
examples/cis3-nft-sponsored-txs/tests/tests.rs Outdated Show resolved Hide resolved
examples/cis3-nft-sponsored-txs/tests/tests.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Bargsteen Bargsteen left a comment

Choose a reason for hiding this comment

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

It's good that you added the tests, but as Ales also pointed out, it is not clear why the tests with generated keys also use the dummy constants. Please explain and/or fix that 😊

examples/cis3-nft-sponsored-txs/tests/tests.rs Outdated Show resolved Hide resolved
@DOBEN DOBEN force-pushed the generating-cis3-signatures-in-test-case branch from 89a385c to 645e074 Compare November 20, 2023 11:40
@DOBEN
Copy link
Member Author

DOBEN commented Nov 20, 2023

It's good that you added the tests, but as Ales also pointed out, it is not clear why the tests with generated keys also use the dummy constants. Please explain and/or fix that 

I added the following explanation:

    // The `viewMessageHash` function uses the same input parameter `PermitParam` as
    // the `permit` function. The `PermitParam` type includes a `signature` and
    // a `signer`. Becuase these two values (`signature` and `signer`) are not
    // read in the `viewMessageHash` function, any value can be used and we choose
    // to use `DUMMY_SIGNATURE` and `ALICE` in the test case below.

examples/cis3-nft-sponsored-txs/tests/tests.rs Outdated Show resolved Hide resolved
@DOBEN DOBEN merged commit afaabcf into main Nov 22, 2023
131 checks passed
@DOBEN DOBEN deleted the generating-cis3-signatures-in-test-case branch November 22, 2023 19:29
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.

4 participants