Skip to content

Commit

Permalink
fix(*): modify fn call_hybrid_vm called position
Browse files Browse the repository at this point in the history
  • Loading branch information
wd30130 committed Aug 13, 2024
1 parent 200a8f1 commit d854799
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 4 additions & 3 deletions frame/hybrid-vm-port/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ impl<T: Config> Pallet<T> {
source: H160,
transaction: Transaction,
) -> Result<(PostDispatchInfo, CallOrCreateInfo), DispatchErrorWithPostInfo> {
if Self::is_hybrid_vm_transaction(transaction.clone()) {
return Self::call_hybrid_vm(source, TransactionData::from(&transaction));
}
let (to, _, info) = Self::execute(source, &transaction, None)?;

let pending = Pending::<T>::get();
Expand Down Expand Up @@ -732,6 +729,10 @@ impl<T: Config> Pallet<T> {
let is_transactional = true;
let validate = false;

if Self::is_hybrid_vm_transaction(transaction.clone()) {
return Self::call_hybrid_vm(from, transaction_data);
}

let (
input,
value,
Expand Down
8 changes: 3 additions & 5 deletions frame/hybrid-vm-port/src/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<T: Config> Pallet<T> {
pub fn call_hybrid_vm(
source: H160,
t: TransactionData,
) -> Result<(PostDispatchInfo, CallOrCreateInfo), DispatchErrorWithPostInfo> {
) -> Result<(Option<H160>, Option<H160>, CallOrCreateInfo), DispatchErrorWithPostInfo> {
let (
input,
value,
Expand Down Expand Up @@ -348,10 +348,8 @@ impl<T: Config> Pallet<T> {
logs: vec![],
};
return Ok((
PostDispatchInfo {
actual_weight: Some(info.gas_consumed),
pays_fee: Pays::Yes,
},
Some(target),
None,
CallOrCreateInfo::Call(call_info),
));
} else {
Expand Down

0 comments on commit d854799

Please sign in to comment.