mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 16:21:06 +00:00
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:
committed by
GitHub
parent
0b4126ca40
commit
4bf0387237
@@ -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> {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -182,6 +182,7 @@ where
|
||||
rent_payed: <BalanceOf<T>>::zero(),
|
||||
pair_count: 0,
|
||||
last_write: None,
|
||||
_reserved: None,
|
||||
};
|
||||
|
||||
*existing = Some(contract.into());
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user