contracts: Release as v3.0.0 and add reserved field to ContractInfoOf (#8175)

* contracts: Update README

* contracts: Add CHANGELOG.md

* contracts: Bump version to v3.0.0 and allow publish

* Typos

Co-authored-by: Andrew Jones <ascjones@gmail.com>

* Improve wording in the changelog

* contracts: Add reserved field to ContractInfoOf for future proofing

* also bump frame-benchmarking

* update lockfile

Co-authored-by: Andrew Jones <ascjones@gmail.com>
Co-authored-by: Benjamin Kampmann <ben@parity.io>
This commit is contained in:
Alexander Theißen
2021-02-25 17:04:48 +01:00
committed by GitHub
parent 0b4126ca40
commit 4bf0387237
17 changed files with 118 additions and 44 deletions
+2
View File
@@ -837,6 +837,8 @@ pub struct RawAliveContractInfo<CodeHash, Balance, BlockNumber> {
pub deduct_block: BlockNumber,
/// Last block child storage has been written.
pub last_write: Option<BlockNumber>,
/// This field is reserved for future evolution of format.
pub _reserved: Option<()>,
}
impl<CodeHash, Balance, BlockNumber> RawAliveContractInfo<CodeHash, Balance, BlockNumber> {
+1 -3
View File
@@ -514,14 +514,12 @@ where
<ContractInfoOf<T>>::remove(&origin);
let tombstone_code_len = E::remove_user(origin_contract.code_hash);
<ContractInfoOf<T>>::insert(&dest, ContractInfo::Alive(AliveContractInfo::<T> {
trie_id: origin_contract.trie_id,
storage_size: origin_contract.storage_size,
pair_count: origin_contract.pair_count,
code_hash,
rent_allowance,
rent_payed: <BalanceOf<T>>::zero(),
deduct_block: current_block,
last_write,
.. origin_contract
}));
let origin_free_balance = T::Currency::free_balance(&origin);
+1
View File
@@ -182,6 +182,7 @@ where
rent_payed: <BalanceOf<T>>::zero(),
pair_count: 0,
last_write: None,
_reserved: None,
};
*existing = Some(contract.into());
+2
View File
@@ -392,6 +392,7 @@ fn account_removal_does_not_remove_storage() {
rent_allowance: 40,
rent_payed: 0,
last_write: None,
_reserved: None,
});
let _ = Balances::deposit_creating(&ALICE, 110);
ContractInfoOf::<Test>::insert(ALICE, &alice_contract_info);
@@ -407,6 +408,7 @@ fn account_removal_does_not_remove_storage() {
rent_allowance: 40,
rent_payed: 0,
last_write: None,
_reserved: None,
});
let _ = Balances::deposit_creating(&BOB, 110);
ContractInfoOf::<Test>::insert(BOB, &bob_contract_info);