Concordium / concordium-rust-smart-contracts

Libraries and tools for writing and testing smart contracts on Concordium
https://docs.rs/concordium-std/latest/concordium_std/
Mozilla Public License 2.0
57 stars 35 forks source link

Generating cis3 signatures in test case #359

Closed DOBEN closed 11 months ago

DOBEN commented 11 months ago

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

DOBEN commented 11 months ago
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.