Releases: Concordium/concordium-rust-smart-contracts
concordium-std 9.0.0
Summary
This release adds support for debugging output when testing smart contracts locally.
Changes
- Add a
concordium_dbg!
macro and the associateddebug
feature to enable,
together withcargo concordium
, to emit debug information during contract
execution. - Update
concordium-contracts-common
dependency to version9
.
concordium-smart-contract-testing 4.0.0
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 theChain
that allows debug symbols
in the deployed module. - Add
DebugInfoExt
trait that has convenience methods for printing debug
information. - Add
debug_trace
field toDebugTraceElement
variants. This records both any
information emitted by theconcordium_dbg!
macro ofconcordium-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 theCARGO_CONCORDIUM_TEST_ALLOW_DEBUG
environment variable that is set bycargo-concordium
when running in debug
mode.
concordium-cis2 6.0.0
Summary
This release adds some convenience features and updates concordium-std to version 9.
Changes
- Add
Clone
trait forStandardIdentifierOwned
. - 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 forOnReceivingCis2DataParams<T, A, D>
. - Add
Serial
trait forOnReceivingCis2DataParams<T, A, D>
. - Update
concordium-std
version to9
.
concordium-smart-contract-testing 3.2.0
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
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
.
- The signature has changed using
- 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.
- They are replaced by concrete types, e.g.
- Add a section in the library documentation about how to migrate your contracts and tests.
- Several traits are also deprecated as they are only needed when using the
concordium-smart-contract-testing 3.1.0
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
.
- Configured via a builder pattern, see
- Add methods to
Chain
:external_query_block
to get the default block used for external queriesblock_time
to get the block timetick_block_time
to increase the block time by aDuration
- Add the following types by re-exporting them from internal crates:
BlockHash
Timestamp
whichSlotTime
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
methodcontract_invoke_external
for more details.
- See the
- Add helper method
parse_return_value
toContractInvokeError
andContractInvokeSuccess
. - Bump minimum supported Rust version to
1.66
.
concordium-cis2 5.1.0
Summary
- Derive
PartialEq
andEq
forCis2Event
,BalanceOfQueryResponse
, andOperatorOfQueryResponse
.
concordium-std 8.0.0
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, whereu
is eitheru8
oru16
. Setting this changes the integer serialization used for the variant tags in derive macros such asSerial
,Deserial
,DeserialWithState
andSchemaType
. - Support adding attribute
#[concordium(tag = n)]
for enum variants, wheren
is some unsigned integer literal. Setting this attribute on a variant overrides the tag used in derive macros such asSerial
,Deserial
,DeserialWithState
andSchemaType
. Note that setting#[concordium(repr(u*))]
is required when using this attribute. - Support adding
#[concordium(forward = n)]
, for enum variants, wheren
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 asSerial
,Deserial
,DeserialWithState
andSchemaType
.
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
andcheck_account_signature
corresponding to the two new host functions
available in protocol 6. Two new types were added to support these operations,
AccountSignatures
andAccountPublicKeys
. - 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
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
andEq
for theTransferEvent
,MintEvent
,BurnEvent
,UpdateOperatorEvent
,TokenMetadataEvent
,OperatorUpdate
, andUpdateOperator
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
Summary
This release contains mainly internal improvements.
Changes
- Set minimum Rust version to 1.65.
- Move
MetadataUrl
from the CIS-2 library toconcordium-std
along with the schema and serialization to make it available to other CIS standards. - Change the
MetadataUrl
schema: use hex string representation forhash
. - Introduce a new method
block_time
as an alias toslot_time
in theHasChainMetadata
trait. - Bump version of concordium-contracts-common to 7.0