Skip to content

Releases: Concordium/concordium-rust-smart-contracts

concordium-std 9.0.0

22 Jan 14:48
Compare
Choose a tag to compare

Summary

This release adds support for debugging output when testing smart contracts locally.

Changes

  • Add a concordium_dbg! macro and the associated debug feature to enable,
    together with cargo concordium, to emit debug information during contract
    execution.
  • Update concordium-contracts-common dependency to version 9.

concordium-smart-contract-testing 4.0.0

22 Jan 14:52
Compare
Choose a tag to compare

Summary

This major release brings the ability to inspect debug output from smart contracts, as well as to attribute costs of operations to different parts of execution.

Changes

  • Add support for debug output when running smart contracts. This adds a new
    module_deploy_v1_debug method to the Chain that allows debug symbols
    in the deployed module.
  • Add DebugInfoExt trait that has convenience methods for printing debug
    information.
  • Add debug_trace field to DebugTraceElement variants. This records both any
    information emitted by the concordium_dbg! macro of concordium-std as well
    as the trace of all the host function calls that occurred.
  • Add is_debug_enabled function to detect whether tests are being run in debug
    mode or not. This function uses the CARGO_CONCORDIUM_TEST_ALLOW_DEBUG
    environment variable that is set by cargo-concordium when running in debug
    mode.

concordium-cis2 6.0.0

22 Jan 14:49
Compare
Choose a tag to compare

Summary

This release adds some convenience features and updates concordium-std to version 9.

Changes

  • Add Clone trait for StandardIdentifierOwned.
  • Add specific parameter type OnReceivingCis2DataParams<T, A, D> for a contract function which receives CIS2 tokens with a specific type D for the AdditionalData.
  • Add Deserial trait for OnReceivingCis2DataParams<T, A, D>.
  • Add Serial trait for OnReceivingCis2DataParams<T, A, D>.
  • Update concordium-std version to 9.

concordium-smart-contract-testing 3.2.0

23 Nov 08:29
66aedcb
Compare
Choose a tag to compare

Summary

This release adds convenience methods to make testing contracts that deal with signatures and public keys more ergonomic.

Changes

  • Bump minimum supported Rust version to 1.67.
  • Re-export AccountKeys.

concordium-std 8.1.0

18 Oct 17:57
Compare
Choose a tag to compare

Summary

The highlight of this release is the deprecation of the test_infrastructure module
in favor of writing integration tests using the smart contract integration testing library.

The test_infrastructure will be removed in one of the following releases.
Users are urged to migrate their integration tests to use the integration testing library which also supports more control over the test setup.

Changes

  • Set minimum Rust version to 1.66.
  • Fix bug in StateMap::get_mut, which allowed multiple mutable references to the state to coexist.
    • The signature has changed using &self to using &mut self.
  • Deprecate the test_infrastructure module in favour of concordium-smart-contract-testing.
    • Several traits are also deprecated as they are only needed when using the test_infrastructure for testing.
    • Among the traits are HasHost, HasStateApi, HasInitContext, HasReceiveContext.
      • They are replaced by concrete types, e.g. Host, StateApi, etc. in the documentation and nearly all example contracts.
    • Add a section in the library documentation about how to migrate your contracts and tests.

concordium-smart-contract-testing 3.1.0

18 Oct 17:53
Compare
Choose a tag to compare

Summary

The highlight of this release is the support for testing smart contracts in the context of a running node.

Additionally there are a number of usability improvements and some bugfixes.

Changes

  • Add functionality for setting the exchange rates and block time of the chain based on queries from an external node.
    • Configured via a builder pattern, see Chain::builder.
  • Add methods to Chain:
    • external_query_block to get the default block used for external queries
    • block_time to get the block time
    • tick_block_time to increase the block time by a Duration
  • Add the following types by re-exporting them from internal crates:
    • BlockHash
    • Timestamp which SlotTime is an alias of.
    • Duration
    • Endpoint
  • Add methods to the Chain for adding external accounts and contracts and for invoking contracts on an external node.
    • See the Chain method contract_invoke_external for more details.
  • Add helper method parse_return_value to ContractInvokeError and ContractInvokeSuccess.
  • Bump minimum supported Rust version to 1.66.

concordium-cis2 5.1.0

18 Oct 17:58
Compare
Choose a tag to compare

Summary

  • Derive PartialEq and Eq for Cis2Event, BalanceOfQueryResponse, and OperatorOfQueryResponse.

concordium-std 8.0.0

21 Aug 06:55
Compare
Choose a tag to compare

Summary

This release adds support for protocol 6, and additionally brings substantial convenience improvements for derivation macros.

Changes

  • Support adding attribute #[concordium(repr(u))] for enum types, where u is either u8 or u16. Setting this changes the integer serialization used for the variant tags in derive macros such as Serial, Deserial, DeserialWithState and SchemaType.
  • Support adding attribute #[concordium(tag = n)] for enum variants, where n is some unsigned integer literal. Setting this attribute on a variant overrides the tag used in derive macros such as Serial, Deserial, DeserialWithState and SchemaType. Note that setting #[concordium(repr(u*))] is required when using this attribute.
  • Support adding #[concordium(forward = n)], for enum variants, where n is either an unsigned integer literal, cis2_events, cis3_events, cis4_events or an array of the same options.
    Setting this attribute on a variant overrides the (de)serialization to flatten with the (de)serialization of the inner field when using derive macros such as Serial, Deserial, DeserialWithState and SchemaType.
    Note that setting #[concordium(repr(u*))] is required when using this attribute.
  • Support protocol 6 smart contract extensions. In particular the HasHost
    trait is extended with two additional host operations, account_public_keys
    and check_account_signature corresponding to the two new host functions
    available in protocol 6. Two new types were added to support these operations,
    AccountSignatures and AccountPublicKeys.
  • Contract state no longer needs to implement StateClone trait in order to work with test infrastructure.
    StateClone itself is completely removed

concordium-cis2 5.0.0

21 Aug 07:08
Compare
Choose a tag to compare

Summary

The major feature of this release is the addition of a Cis2Client which can be used by other contracts that interact with a CIS2 contract to simplify the interactions.

Changes

  • Derive PartialEq and Eq for the TransferEvent, MintEvent, BurnEvent, UpdateOperatorEvent, TokenMetadataEvent, OperatorUpdate, and UpdateOperator types.
  • Added Cis2Client to the library. This can be used from one smart contract to
    call into other cis2 compatible smart contracts in a type safe way.
  • Bump concordium-std to version 8.

concordium-std 7.0.0

16 Jun 10:55
Compare
Choose a tag to compare

Summary

This release contains mainly internal improvements.

Changes

  • Set minimum Rust version to 1.65.
  • Move MetadataUrl from the CIS-2 library to concordium-std along with the schema and serialization to make it available to other CIS standards.
  • Change the MetadataUrl schema: use hex string representation for hash.
  • Introduce a new method block_time as an alias to slot_time in the HasChainMetadata trait.
  • Bump version of concordium-contracts-common to 7.0