|
1 | 1 | # CHANGELOG
|
2 | 2 |
|
| 3 | +## 0.12.0 (2020-11-19) |
| 4 | + |
| 5 | +**cosmwasm-std** |
| 6 | + |
| 7 | +- Remove the previously deprecated `StdError::Unauthorized`. Contract specific |
| 8 | + errors should be implemented using custom error types now (see |
| 9 | + [migration guide](./MIGRATING.md) 0.10 -> 0.11). |
| 10 | +- Use dependency `thiserror` instead of `snafu` to implement `StdError`. Along |
| 11 | + with this change, the `backtraces` feature now requires Rust nightly. |
| 12 | +- Rename `StdError::ParseErr::source` to `StdError::ParseErr::source_type` and |
| 13 | + `StdError::SerializeErr::target` to `StdError::SerializeErr::target_type` to |
| 14 | + work around speacial treatment of the field name `source` in thiserror. |
| 15 | +- Rename `Extern` to `Deps` to unify naming. |
| 16 | +- Simplify ownership of calling `handle`, etc. with `Deps` and `DepsMut` struct |
| 17 | + that just contains references (`DepsMut` has `&mut Storage` otherwise the |
| 18 | + same) |
| 19 | +- Remove unused `Deps::change_querier`. If you need this or similar |
| 20 | + functionality, create a new struct with the right querier. |
| 21 | +- Remove `ReadonlyStorage`. You can just use `Storage` everywhere. And use |
| 22 | + `&Storage` to provide readonly access. This was only needed to let |
| 23 | + `PrefixedStorage`/`ReadonlyPrefixedStorage` implement the common interface, |
| 24 | + which is something we don't need. |
| 25 | + |
| 26 | +**cosmwasm-storage** |
| 27 | + |
| 28 | +- `PrefixedStorage`/`ReadonlyPrefixedStorage` do not implement the |
| 29 | + `Storage`/`ReadonlyStorage` traits anymore. If you need nested prefixes, you |
| 30 | + need to construct them directly via `PrefixedStorage::multilevel` and |
| 31 | + `ReadonlyPrefixedStorage::multilevel`. |
| 32 | +- Remove unused `TypedStorage`. If you need this or similar functionality, you |
| 33 | + probably want to use `Bucket` or `Singleton`. If you really need it, please |
| 34 | + copy the v0.11 code into your project. |
| 35 | +- Remove `StorageTransaction` along with `transactional` and `RepLog`. This has |
| 36 | + not been used actively for contract development and is now maintained in a |
| 37 | + contract testing framework. |
| 38 | + |
| 39 | +**cosmwasm-vm** |
| 40 | + |
| 41 | +- Remove `Storage::range` and `StorageIterator`. The storage implementation is |
| 42 | + now responsible for maintaining iterators internally and make them accessible |
| 43 | + via the new `Storage::scan` and `Storage::next` methods. |
| 44 | +- Add `FfiError::IteratorDoesNotExist`. Looking at this, `FfiError` should |
| 45 | + probably be renamed to something that includes before, on and behind the FFI |
| 46 | + boundary to Go. |
| 47 | +- `MockStorage` now implementes the new `Storage` trait and has an additional |
| 48 | + `MockStorage::all` for getting all elements of an iterator in tests. |
| 49 | +- Remove unused `Extern::change_querier`. If you need this or similar |
| 50 | + functionality, create a new struct with the right querier. |
| 51 | +- Let `Instance::from_code` and `CosmCache::get_instance` take options as an |
| 52 | + `InstanceOptions` struct. This contains `gas_limit` and `print_debug` for now |
| 53 | + and can easily be extended. `cosmwasm_vm::testing::mock_instance_options` can |
| 54 | + be used for creating such a struct in integration tests. |
| 55 | +- Make `FileSystemCache` crate internal. This should be used via `CosmCache`. |
| 56 | +- Fix return type of `FileSystemCache::load` to `VmResult<Option<Module>>` in |
| 57 | + order to differentiate missing files from errors. |
| 58 | +- Add in-memory caching for recently used Wasm modules. |
| 59 | +- Rename `CosmCache` to just `cosmwasm_vm::Cache` and add `CacheOptions` to |
| 60 | + configure it. |
| 61 | +- Rename `Extern` to `Backend`. |
| 62 | +- Rename `mock_dependencies` to `mock_backend` and |
| 63 | + `mock_dependencies_with_balances` to `mock_backend_with_balances`. |
| 64 | +- Rename `FfiError`/`FfiResult` to `BackendError`/`BackendResult` and adapt |
| 65 | + `VmError` accordingly. |
| 66 | + |
| 67 | +## 0.11.2 (2020-10-26) |
| 68 | + |
| 69 | +**cosmwasm-std** |
| 70 | + |
| 71 | +- Implement `From<std::str::Utf8Error>` and `From<std::string::FromUtf8Error>` |
| 72 | + for `StdError`. |
| 73 | +- Generalize denom argument from `&str` to `S: Into<String>` in `coin`, `coins` |
| 74 | + and `Coin::new`. |
| 75 | +- Implement `PartialEq` between `Binary` and `Vec<u8>`/`&[u8]`. |
| 76 | +- Add missing `PartialEq` implementations between `HumanAddr` and `str`/`&str`. |
| 77 | +- Add `Binary::to_array`, which allows you to copy binary content into a |
| 78 | + fixed-length `u8` array. This is espeically useful for creating integers from |
| 79 | + binary data. |
| 80 | + |
| 81 | +## 0.11.1 (2020-10-12) |
| 82 | + |
| 83 | +**cosmwasm-std** |
| 84 | + |
| 85 | +- Implement `Hash` and `Eq` for `Binary` to allow using `Binary` in `HashSet` |
| 86 | + and `HashMap`. |
| 87 | +- Implement `Hash` and `Eq` for `CanonicalAddr` to allow using `CanonicalAddr` |
| 88 | + in `HashSet` and `HashMap`. |
| 89 | +- Implement `Add`, `AddAssign` and `Sub` with references on the right hand side |
| 90 | + for `Uint128`. |
| 91 | +- Implement `Sum<Uint128>` and `Sum<&'a Uint128>` for `Uint128`. |
| 92 | + |
| 93 | +## 0.11.0 (2020-10-08) |
| 94 | + |
| 95 | +**all** |
| 96 | + |
| 97 | +- Drop support for Rust versions lower than 1.45.2. |
| 98 | +- The serialization of the result from `init`/`migrate`/`handle`/`query` changed |
| 99 | + in an incompatible way. See the new `ContractResult` and `SystemResult` types |
| 100 | + and their documentation. |
| 101 | +- Pass `Env` into `query` as well. As this doesn't have `MessageInfo`, we |
| 102 | + removed `MessageInfo` from `Env` and pass that as a separate argument to |
| 103 | + `init`, `handle`, and `query`. See the example |
| 104 | + [type definitions in the README](README.md#implementing-the-smart-contract) to |
| 105 | + see how to update your contract exports (just add one extra arg each). |
| 106 | + |
| 107 | +**cosmwasm-std** |
| 108 | + |
| 109 | +- Add `time_nanos` to `BlockInfo` allowing access to high precision block times. |
| 110 | +- Change `FullDelegation::accumulated_rewards` from `Coin` to `Vec<Coin>`. |
| 111 | +- Rename `InitResponse::log`, `MigrateResponse::log` and `HandleResponse::log` |
| 112 | + to `InitResponse::attributes`, `MigrateResponse::attributes` and |
| 113 | + `HandleResponse::attributes`. |
| 114 | +- Rename `LogAttribute` to `Attribute`. |
| 115 | +- Rename `log` to `attr`. |
| 116 | +- Rename `Context::add_log` to `Context::add_attribute`. |
| 117 | +- Add `Api::debug` for emitting debug messages during development. |
| 118 | +- Fix error type for response parsing errors in `ExternalQuerier::raw_query`. |
| 119 | + This was `Ok(Err(StdError::ParseErr))` instead of |
| 120 | + `Err(SystemError::InvalidResponse)`, implying an error created in the target |
| 121 | + contract. |
| 122 | +- Deprecate `StdError::Unauthorized` and `StdError::unauthorized` in favour of |
| 123 | + custom errors. From now on `StdError` should only be created by the standard |
| 124 | + library and should only contain cases the standard library needs. |
| 125 | +- Let `impl Display for CanonicalAddr` use upper case hex instead of base64. |
| 126 | + This also affects `CanonicalAddr::to_string`. |
| 127 | +- Create trait `CustomQuery` for the generic argument in |
| 128 | + `QueryRequest<C: CustomQuery>`. This allows us to provide |
| 129 | + `impl<C: CustomQuery> From<C> for QueryRequest<C>` for any custom query. |
| 130 | +- Implement `From<Binary> for Vec<u8>`. |
| 131 | +- Implement `From<CanonicalAddr> for Vec<u8>`. |
| 132 | +- Add `Binary::into_vec` and `CanonicalAddr::into_vec`. |
| 133 | +- The `canonical_length` argument was removed from `mock_dependencies`, |
| 134 | + `mock_dependencies_with_balances`. In the now deprecated `MockApi::new`, the |
| 135 | + argument is unused. Contracts should not need to set this value and usually |
| 136 | + should not make assumptions about the value. |
| 137 | +- The canonical address encoding in `MockApi::canonical_address` and |
| 138 | + `MockApi::human_address` was changed to an unpredicatable represenation of |
| 139 | + non-standard length that aims to destroy most of the input structure. |
| 140 | + |
| 141 | +**cosmwasm-storage** |
| 142 | + |
| 143 | +- Change order of arguments such that `storage` is always first followed by |
| 144 | + namespace in `Bucket::new`, `Bucket::multilevel`, `ReadonlyBucket::new`, |
| 145 | + `ReadonlyBucket::multilevel`, `bucket` and `bucket_read`. |
| 146 | +- Change order of arguments such that `storage` is always first followed by |
| 147 | + namespace in `PrefixedStorage::new`, `PrefixedStorage::multilevel`, |
| 148 | + `ReadonlyPrefixedStorage::new`, `ReadonlyPrefixedStorage::multilevel`, |
| 149 | + `prefixed` and `prefixed_read`. |
| 150 | + |
| 151 | +**cosmwasm-vm** |
| 152 | + |
| 153 | +- `CosmCache::new`, `Instance::from_code` and `Instance::from_module` now take |
| 154 | + an additional argument to enable/disable printing debug logs from contracts. |
| 155 | +- Bump required export `cosmwasm_vm_version_3` to `cosmwasm_vm_version_4`. |
| 156 | +- The `canonical_length` argument was removed from `mock_dependencies`, |
| 157 | + `mock_dependencies_with_balances` and `MockApi::new_failing`. In the now |
| 158 | + deprecated `MockApi::new`, the argument is unused. Contracts should not need |
| 159 | + to set this value and usually should not make assumptions about the value. |
| 160 | +- The canonical address encoding in `MockApi::canonical_address` and |
| 161 | + `MockApi::human_address` was changed to an unpredicatable represenation of |
| 162 | + non-standard length that aims to destroy most of the input structure. |
| 163 | + |
| 164 | +## 0.10.1 (2020-08-25) |
| 165 | + |
| 166 | +**cosmwasm-std** |
| 167 | + |
| 168 | +- Fix bug where `ExternalStorage.range()` would cause VM error if either lower |
| 169 | + or upper bound was set |
| 170 | + ([#508](https://github.com/CosmWasm/cosmwasm/issues/508)) |
| 171 | + |
3 | 172 | ## 0.10.0 (2020-07-30)
|
4 | 173 |
|
5 | 174 | **all**
|
|
0 commit comments