git.delta.rocks / unique-network / refs/commits / e17babf20196

difftreelog

Contract address fix

str-mv2021-03-05parent: #7a3c206.patch.diff
in: master

2 files changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
34use sp_runtime::sp_std::prelude::Vec;34use sp_runtime::sp_std::prelude::Vec;
35use sp_runtime::{35use sp_runtime::{
36 traits::{36 traits::{
37 DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion, SignedExtension, Zero,37 Hash, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion, SignedExtension, Zero,
38 },38 },
39 transaction_validity::{39 transaction_validity::{
40 TransactionPriority, InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction,40 TransactionPriority, InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction,
43};43};
44use sp_runtime::traits::StaticLookup;44use sp_runtime::traits::StaticLookup;
45use pallet_contracts::chain_extension::UncheckedFrom;45use pallet_contracts::chain_extension::UncheckedFrom;
46use pallet_contracts::*;
46use pallet_transaction_payment::OnChargeTransaction;47use pallet_transaction_payment::OnChargeTransaction;
4748
48#[cfg(test)]49#[cfg(test)]
2581 T::AccountId::default()2582 T::AccountId::default()
2582 },2583 },
2584
2585 // On instantiation with code: set the contract owner
2586 Some(pallet_contracts::Call::instantiate_with_code(_endowment, _gas_limit, _code, _data, _salt)) => {
2587
2588 let new_contract_address = <pallet_contracts::Module<T>>::contract_address(
2589 &who,
2590 &T::Hashing::hash(&_code),
2591 _salt,
2592 );
2593
2594 <ContractOwner<T>>::insert(new_contract_address.clone(), who.clone());
2595
2596 T::AccountId::default()
2597 }
25832598
2584 // When the contract is called, check if the sponsoring is enabled and pay fees from contract endowment if it is2599 // When the contract is called, check if the sponsoring is enabled and pay fees from contract endowment if it is
2585 Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {2600 Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
modifiedruntime/src/lib.rsdiffbeforeafterboth
565 system::CheckEra<Runtime>,565 system::CheckEra<Runtime>,
566 system::CheckNonce<Runtime>,566 system::CheckNonce<Runtime>,
567 system::CheckWeight<Runtime>,567 system::CheckWeight<Runtime>,
568 // pallet_nft::ChargeTransactionPayment<Runtime>,568 pallet_nft::ChargeTransactionPayment<Runtime>,
569);569);
570/// Unchecked extrinsic type as expected by this runtime.570/// Unchecked extrinsic type as expected by this runtime.
571pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;571pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;