@@ -148,8 +148,8 @@ major releases of `cosmwasm`. Note that you can also view the
148
148
+CosmosMsg::Any(AnyMsg { type_url, value })
149
149
```
150
150
151
- - Replace all direct construction of ` StdError ` with use of the corresponding
152
- constructor:
151
+ - Replace all direct construction of ` StdError ` with the use of the
152
+ corresponding constructor:
153
153
154
154
``` diff
155
155
-StdError::GenericErr { msg }
@@ -259,7 +259,7 @@ major releases of `cosmwasm`. Note that you can also view the
259
259
260
260
The payload data will then be available in the new field ` Reply.payload ` in
261
261
the ` reply ` entry point. This functionality is an optional addition introduced
262
- in 2.0. To keep the CosmWasm 1.x behaviour , just set payload to
262
+ in 2.0. To keep the CosmWasm 1.x behavior , just set payload to
263
263
` Binary::default() ` .
264
264
265
265
- In test code, replace calls to ` mock_info ` with ` message_info ` . This takes a
@@ -393,7 +393,7 @@ major releases of `cosmwasm`. Note that you can also view the
393
393
# ...
394
394
```
395
395
396
- - There are changes to how we generate schemas, resulting in less boilerplace
396
+ - There are changes to how we generate schemas, resulting in less boilerplate
397
397
maintenance for smart contract devs. Old contracts will continue working for a
398
398
while, but it's highly recommended to migrate now.
399
399
@@ -570,9 +570,9 @@ arbitrary ones.
570
570
annotations. See the [ 0.13 -> 0.14 entry] ( #013---014 ) where ` #[entry_point] `
571
571
was introduced.
572
572
573
- - If your chain provides a custom queries , add the custom query type as a
574
- generic argument to ` cosmwasm_std::Deps ` , ` DepsMut ` , ` OwnedDeps ` and
575
- ` QuerierWrapper ` . Otherwise it defaults to ` Empty ` . E.g.
573
+ - If your chain provides a custom query , add the custom query type as a generic
574
+ argument to ` cosmwasm_std::Deps ` , ` DepsMut ` , ` OwnedDeps ` and ` QuerierWrapper ` .
575
+ Otherwise, it defaults to ` Empty ` . E.g.
576
576
577
577
``` diff
578
578
#[entry_point]
@@ -1313,30 +1313,30 @@ arbitrary ones.
1313
1313
which a compact binary representation is desired. For JSON state this does not
1314
1314
save much data (e.g. the bech32 address
1315
1315
cosmos1pfq05em6sfkls66ut4m2257p7qwlk448h8mysz takes 45 bytes as direct ASCII
1316
- and 28 bytes when its canonical representation is base64 encoded). For fixed
1317
- length database keys ` CanonicalAddr ` remains handy though.
1316
+ and 28 bytes when its canonical representation is base64 encoded). For
1317
+ fixed- length database keys ` CanonicalAddr ` remains handy though.
1318
1318
1319
1319
- Replace ` StakingMsg::Withdraw ` with ` DistributionMsg::SetWithdrawAddress ` and
1320
1320
` DistributionMsg::WithdrawDelegatorReward ` . ` StakingMsg::Withdraw ` was a
1321
1321
shorthand for the two distribution messages. However, it was unintuitive
1322
- because it did not set the address for one withdraw only but for all following
1323
- withdrawls . Since withdrawls are [ triggered by different
1322
+ because it did not set the address for one withdrawal only but for all
1323
+ following withdrawals . Since withdrawals are [ triggered by different
1324
1324
events] [ distribution docs ] such as validators changing their commission rate,
1325
1325
an address that was set for a one-time withdrawal would be used for future
1326
- withdrawls not considered by the contract author.
1326
+ withdrawals not considered by the contract author.
1327
1327
1328
- If the contract never set a withdraw address other than the contract itself
1328
+ If the contract never set a withdrawal address other than the contract itself
1329
1329
(` env.contract.address ` ), you can simply replace ` StakingMsg::Withdraw ` with
1330
1330
` DistributionMsg::WithdrawDelegatorReward ` . It is then never changed from the
1331
- default. Otherwise you need to carefully track what the current withdraw
1332
- address is. A one-time change can be implemented by emitted 3 messages:
1331
+ default. Otherwise, you need to carefully track what the current withdrawal
1332
+ address is. A one-time change can be implemented by emitting 3 messages:
1333
1333
1334
1334
1 . ` SetWithdrawAddress { address: recipient } ` to temporarily change the
1335
1335
recipient
1336
1336
2 . ` WithdrawDelegatorReward { validator } ` to do a manual withdrawal from the
1337
1337
given validator
1338
1338
3 . ` SetWithdrawAddress { address: env.contract.address.into() } ` to change it
1339
- back for all future withdrawls
1339
+ back for all future withdrawals
1340
1340
1341
1341
[ distribution docs ] : https://docs.cosmos.network/v0.42/modules/distribution/
1342
1342
@@ -1534,7 +1534,7 @@ arbitrary ones.
1534
1534
}
1535
1535
```
1536
1536
1537
- Once you got familiar with the concept, you can create different error types
1537
+ Once you get familiar with the concept, you can create different error types
1538
1538
for each of the contract's functions.
1539
1539
1540
1540
You can also try a different error library than
@@ -1786,8 +1786,8 @@ Contract code and uni tests:
1786
1786
- ` cosmwasm_storage::get_with_prefix ` , ` cosmwasm_storage::set_with_prefix ` ,
1787
1787
` cosmwasm_storage::RepLog::commit ` , ` cosmwasm_std::ReadonlyStorage::get ` ,
1788
1788
` cosmwasm_std::ReadonlyStorage::range ` , ` cosmwasm_std::Storage::set ` and
1789
- ` cosmwasm_std::Storage::remove ` now return the value directly that was wrapped
1790
- in a result before.
1789
+ ` cosmwasm_std::Storage::remove ` now returns the value directly that was
1790
+ wrapped in a result before.
1791
1791
- Error creator functions are now in type itself, e.g.
1792
1792
` StdError::invalid_base64 ` instead of ` invalid_base64 ` . The free functions are
1793
1793
deprecated and will be removed before 1.0.
@@ -1876,7 +1876,7 @@ Contract Code:
1876
1876
1877
1877
- Complete overhaul of ` cosmwasm::Error ` into ` cosmwasm_std::StdError ` :
1878
1878
- Auto generated snafu error constructor structs like ` NotFound ` /` ParseErr ` /…
1879
- have been privatized in favour of error generation helpers like
1879
+ have been privatized in favor of error generation helpers like
1880
1880
` not_found ` /` parse_err ` /…
1881
1881
- All error generator functions now return errors instead of results, such
1882
1882
that e.g. ` return unauthorized(); ` becomes ` return Err(unauthorized()); `
@@ -1911,7 +1911,7 @@ Both:
1911
1911
- ` dependencies ` was renamed to ` mock_dependencies ` . ` mock_dependencies ` and
1912
1912
` mock_instance ` take a 2nd argument to set the contract balance (visible for
1913
1913
the querier). If you need to set more balances, use ` mock_XX_with_balances ` .
1914
- The follow code block explains:
1914
+ The following code block explains:
1915
1915
1916
1916
``` rust
1917
1917
// before: balance as last arg in mock_env
@@ -1933,7 +1933,7 @@ Integration Tests:
1933
1933
- Before:
1934
1934
` match err { ContractResult::Err(msg) => assert_eq!(msg, "Unauthorized"), ... } `
1935
1935
- After: ` match err { Err(StdError::Unauthorized{ .. }) => {}, ... } `
1936
- - Remove all imports / use of ` ContractResult `
1936
+ - Remove all imports/ use of ` ContractResult `
1937
1937
- You must specify ` CosmosMsg::Native ` type when calling
1938
1938
` cosmwasm_vm::testing::{handle, init} ` . You will want to
1939
1939
` use cosmwasm_std::{HandleResult, InitResult} ` or
0 commit comments