pub struct TestCryptoPrimitives { /* private fields */ }
Expand description
A HasCryptoPrimitives
implementation used for unit testing smart
contracts.
You can test smart contracts that use the cryptographic primitives in two different ways:
- By setting up mock responses for the functions you need, for example with
the
setup_hash_sha_256_mock
method. - Or, by using the actual implementations. For this, you need to enable the “crypto-primitives” feature.
Implementations§
Source§impl TestCryptoPrimitives
impl TestCryptoPrimitives
Sourcepub fn new() -> Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn new() -> Self
Create a new TestCryptoPrimitives
, for which no mocks has been set
up.
Sourcepub fn setup_verify_ed25519_signature_mock<F>(&self, mock: F)
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn setup_verify_ed25519_signature_mock<F>(&self, mock: F)
Set up a mock for verify_ed25519_signature
.
This is not available if the “crypto-primitives” feature is enabled. For
more information on why, see the documentation of
TestCryptoPrimitives
.
Sourcepub fn setup_verify_ecdsa_secp256k1_signature_mock<F>(&self, mock: F)
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn setup_verify_ecdsa_secp256k1_signature_mock<F>(&self, mock: F)
Set up a mock for verify_ecdsa_secp256k1_signature
.
This is not available if the “crypto-primitives” feature is enabled. For
more information on why, see the documentation of
TestCryptoPrimitives
.
Sourcepub fn setup_hash_sha2_256_mock<F>(&self, mock: F)
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn setup_hash_sha2_256_mock<F>(&self, mock: F)
Set up a mock for
hash_sha2_256
.
This is not available if the “crypto-primitives” feature is enabled. For
more information on why, see the documentation of
TestCryptoPrimitives
.
Sourcepub fn setup_hash_sha3_256_mock<F>(&self, mock: F)
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn setup_hash_sha3_256_mock<F>(&self, mock: F)
Set up a mock for
hash_sha3_256
.
This is not available if the “crypto-primitives” feature is enabled. For
more information on why, see the documentation of
TestCryptoPrimitives
.
Sourcepub fn setup_hash_keccak_256_mock<F>(&self, mock: F)
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn setup_hash_keccak_256_mock<F>(&self, mock: F)
Set up a mock for
hash_keccak_256
.
This is not available if the “crypto-primitives” feature is enabled. For
more information on why, see the documentation of
TestCryptoPrimitives
.
Trait Implementations§
Source§impl Default for TestCryptoPrimitives
Create a new TestCryptoPrimitives
, for which no mocks has been set up.
impl Default for TestCryptoPrimitives
Create a new TestCryptoPrimitives
, for which no mocks has been set up.