Releases: scrtlabs/secret-toolkit
V0.5.0 - Storage fixes
This release includes some minor fixed to the storage package which required some breaking changes.
We are releasing these breaking changes because we reached the conclusion that the current interfaces
are prone to bugs, or inefficient. Unless you are using these specific interfaces, you should be able to upgrade from 0.4 without issues.
Breaking
- Removed the implementations of Clone for storage types which are not useful and may cause data corruption if used incorrectly.
- Changed
Keymap::insertto take the item by reference rather than by value. This should reduce the cost of calling that function by avoiding cloning.
Features
- Changed the implementation of the
add_prefixmethods in the storage package to use length prefixing, which should help avoid namespace collisions.
secret-toolkit-storage v0.4.2
- Simplified implementation of
.clonemethod - Added
.add_suffixand.clonemethods tosecret-toolkit::storage::Item - Minor performance updates to
secret-toolkit::storage::Keymap
Contributor: @srdtrk
secret-toolkit-storage v0.4.1
BUGFIX: Item::is_empty was returning the opposite value from what you'd expect.
v0.4.0 - Better Storage
This release mostly includes the work of @srdtrk in #53. Thanks Srdtrk!
It revamps the secret-toolkit-storage package to make it more similar to cw-storage-plus and much easier
to use. It also removes the Cashmap type from the incubator in favor of KeyMap in secret-toolkit-storage.
This is a summary of the changes and additions in this release:
- Minimum Rust version is bumped to the latest v1.63. This is because we want to use
Mutex::newin aconst fn. - No more distinction between
Readonly*and*Muttypes. Instead, methods take references or mutable references to the storage every time. - Usage of
PrefixedStoreis made mostly unnecessary. - Storage type's constructors are const functions, which means they can be initialized as global static variables.
- Added
secret-toolkit::storage::Itemwhich is similar toItemfromcw-storage-plusorTypedStorefromcosmwasm_storagev0.10. - Added
secret-toolkit::storage::KeyMapwhich is similar toCashmap. Cashmapis completely removed.
A full guide to using the new storage types can be found
in the package's readme file.
v0.3.0 - Shockwave
This release includes new features and utilities, bugfixes, and replaces secp256k signing and validation with the pre-compiled functions in the new crypto APIs introduced in the Shockwave Alpha update which should improve performance significantly.
New features
- Added
clearmethod toAppendStoreandDequeStoreto quickly reset the collections (#34) - docs.rs documentation now includes all sub-crates.
- BUGFIX:
secret-toolkit::snip721::Metadatawas severely out of date with the SNIP-721 specification, and not useful.
It is now compatible with deployed SNIP-721 contracts. - Added
typesmodule under theutilpackage, to standardize often used types. - Added
secret-toolkit::viewing_key, which can be imported by enabling theviewing-keyfeature. - Added
secret-toolkit::permit::PubKey::canonical_address(). - Types in
secret-toolkit::permit::Permitare now generic over the type of permissions they accept. - Added the
maxheaptype to the incubator. - Added
secret-toolkit::utils::feature_togglewhich allow managing feature flags in your contract.
Breaking
secret-toolkit::permit::validate()Now supports validating any type of Cosmos address.
Interface changes: Now takes a reference to the current token address instead
of taking it by value and an optional hrp string.
In addition, it returns a String and not HumanAddr.- Renamed
secret-toolkit::permit::Permissiontosecret-toolkit::permit::TokenPermission. secret-toolkit-cryptonow has features["hash", "rng" and "ecc-secp256k1"]which are all off by default - enable those you need.secret-toolkit-crypto::secp256k1::PublicKey::parsenow returnsStdResult<Self>.- Changes to
secret-toolkit::crypto::secp256k1::PrivateKey::sign:- The
dataargument is now any slice of bytes, and not the hash of a slice of data. - the
Apifromdeps.apiis now required as the second argument as we now use the precompiled implementation.
- The
- Changes to
secret-toolkit::crypto::secp256k1::PublicKey::verify:- the
Apifromdeps.apiis now required as the third argument as we now use the precompiled implementation.
- the
secret-toolkit-incubatornow has features["cashmap", "generational-store"]which are all off by default.
v0.2.0
This release includes a ton of new features, and a few breaking changes in various interfaces.
This version is also the first released to crates.io!
- Change: when a query fails because of a bad viewing key, this now correctly fails with
StdError::Unauthorized - Added support for some missing SNIP-20 functionality, such as
CreateViewingKey - Added support for SNIP-21 queries (memos and improved history) which broke some interfaces
- Added support for SNIP-22 messages (batch operations)
- Added support for SNIP-23 messages (improved Send operations) which broke some interfaces
- Added support for SNIP-24 permits
- Added
Base64Of<S: Serde, T>,Base64JsonOf<T>, andBase64Bincode2Of<T>,
which are wrappers that automatically deserializes base64 strings toT.
It can be used in message types' fields instead ofBinarywhen the contents of the string
should have more specific contents. - Added
storage::DequeStore- Similar toAppendStorebut allows pushing and popping on both ends - Added the
secret-toolkit::incubatorpackage intended for experimental features. It contains:CashMap- A hashmap like storage abstractionGenerationalIndex- A generational index storage abstraction
- The various subpackages can now be selected using feature flags. The default flags are
["serialization", "snip20", "snip721", "storage", "utils"]
while["crypto", "permit", "incubator"]are left disabled by default.
V0.1.1
v0.1.0
This is the first release of secret-toolkit. It supports:
secret-toolkit::snip20- Helper types and functions for interaction with
SNIP-20 contracts.secret-toolkit::snip721- Helper types and functions for interaction with
SNIP-721 contracts.secret-toolkit::crypto- Wrappers for known-to-work crypto primitives from
ecosystem libraries. We include implementations for Sha256, Secp256k1 keys,
and ChaChaRng.secret-toolkit::storage- Types implementing useful storage managements
techniques:AppendStoreandTypedStore, usingbincode2by default.secret-toolkit::serialization- marker types for overriding the storage
format used by types insecret-toolkit::storage.JsonandBincode2.secret-toolkit::utils- General utilities for writing contract code.padding- tools for padding queries and responses.calls- Tools for marking types as messages in queries and callbacks
to other contracts.