Releases: Concordium/concordium-rust-sdk
Releases · Concordium/concordium-rust-sdk
concordium-rust-sdk 2.4.0
Summary
This is a minor release which updates the dependencies.
In particular using derive macros for smart contracts serialization now requires an extra import. See changes for details.
Changes
- Re-export
concordium_base
to enable use ofconcordium_base_derive
serialization macros. - Bump minimum supported rust version to 1.64.
- When using derive(Serial,Deserial) macros from the smart_contracts modules
concordium_std
must be made available, for example as
use concordium_rust_sdk::smart_contracts::common as concordium_std
concordium-rust-sdk 2.3.0
This is the first release of the SDK published in the crates.io package repository.
The following changes are made compared to version 2.2.0.
- Add
find_earliest_finalized
,find_instance_creation
,
find_first_finalized_block_no_later_than
methods to thev2
client. - Bump MSRV to 1.62
- Add deprecation notices to
ModuleRef
andParameter
. UseModuleReference
andOwnedParameter
, respectively, instead.- Replace
AsRef<Vec<u8>>
withAsRef<[u8]>
forOwnedParameter
(and
thereby also for the now deprecatedParameter
).- Migrate from
parameter.as_ref()
: Use¶meter.as_ref().to_vec()
instead.
- Migrate from
OwnedParameter
also has a number of additional methods and trait
implementations, namely:- A
from_serial
method which constructs a new parameter by serializing the
input and checking that the length is valid. - An
empty
method which constructs an empty parameter. - An
Into<Vec<u8>>
implementation for getting the innerbytes
. - An
as_parameter
method for converting it to the borrowed version
Parameter(&[u8])
type (not to be confused with the now deprecated
Parameter(Vec<u8>)
).
- Replace
concordium-rust-sdk 2.2.0
concordium-rust-sdk
2.2.0 (2023-02-06)
This is a minor update that adds a number of quality of life improvements.
- Add helpers to
WalletAccount
so that it can be constructed from genesis
account format produced by the genesis creator tool, as well as from browser
key export format. - Fix contract schema's
to_json
to output contract addresses in the correct format. - Add a
Display
implementation forContractEvent
. - Add
_single
family of functions toCis2Contract
to make it easier to do
queries and updates for a single token or operator. - Generalize the signature of
Cis2Contract
methods that take a block
identifier. They now takeimpl IntoBlockIdentifier
. All existing uses should
remain working since&BlockIdentifier
implements this trait. - Add
is_rejected_account_transaction
helper toBlockItemSummary
to help
extract reject reason for an account transaction. - Add
update_operator_dry_run
andtransfer_dry_run
methods to
Cis2Contract
. These dry-runupdate_operator
andtransfer
transactions
usinginvoke_instance
. They can be used to estimate transaction costs, and
check whether the call will succeed. - Add
is_payday_block
helper function tov2::Client
to identify whether a specific block is one that includes payday events. - Add
new_from_payload
helper toContractContext
for convenience when
dry-running smart contract update transactions. - Add a notion of
TokenAddress
and its string representation based on base58 encoding.
concordium-rust-sdk 2.0.0
This is a major release which breaks compatibility in some areas.
This release adds support for protocol 5, and adds support for GRPC V2. In addition, there are a number of bugfixes and quality of life improvements.
Changelog
- Expose macros for deriving
Serial
andDeserial
fromconcordium-contracts-common
. - Address method
is_alias_of
is nowis_alias
. - Replaced
ReceiveName
andInitName
withOwnedReceiveName
andOwnedContractName
fromconcordium-contracts-common
. - Remove
ContractAddress
andAddress
in favor of their equivalents inconcordium-contracts-common
. AccountAddress::new
is replaced by a function calledaccount_address_from_registration_id
.Amount
now has a fieldmicro_ccd
instead ofmicrogtu
.- The default arithmetic (operator syntax, such as
+
,-
,*
) withAmount
is now unchecked. - There are no longer implementations of
From<u64> for Amount
andFrom<Amount> for u64
as the behavior of these is not obvious.
Instead, the functionsAmount::from_micro_ccd
orAmount::from_ccd
and the gettermicro_ccd
should be used instead. - Implement
Display
andFromStr
forContractAddress
formatted as<index, subindex>
, E.g<145,0>
. - Implement
Display
andFromStr
forAddress
. The latter attempts to parse a contract address. If this fails it will attempt to parse anAccountAddress
. - Implement
FromStr
forOwnedReceiveName
. - Remove the
From<Vec<u8>>
implementation forParameter
. Instead aTryFrom
is
provided that checks the length. - Add support for the node's GRPC V2 interface.
- Bump minimum supported Rust version to 1.57.
- Add support for CIS0 standard.
- The CIS2 support now uses the V2 node API. This has led so small changes in
the API. - Add support for protocol version 5 events and limitations.
- Deprecate
add_baker
,update_baker_keys
,remove_baker
,
update_baker_stake
,update_baker_restake_earnings
functions. They only
apply to protocol versions 1-3 and are replaced byconfigure_baker
.