mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 04:01:10 +00:00
contracts: Change define_env! to expect a Result<T, DispatchError> for every function (#7762)
* Make host functions return TrapReason This avoids the need to manually store any trap reasons to the `Runtime` from the host function. This adds the following benefits: * It properly composes with the upcoming chain extensions * Missing to set a trap value is now a compile error * review: Remove superflous .into()
This commit is contained in:
committed by
GitHub
parent
dd8e7587cb
commit
ab876be9e9
@@ -1537,7 +1537,7 @@ mod tests {
|
||||
&mut gas_meter
|
||||
),
|
||||
Err(ExecError {
|
||||
error: Error::<Test>::ContractTrapped.into(),
|
||||
error: Error::<Test>::TooManyTopics.into(),
|
||||
origin: ErrorOrigin::Caller,
|
||||
})
|
||||
);
|
||||
@@ -1582,7 +1582,7 @@ mod tests {
|
||||
&mut gas_meter
|
||||
),
|
||||
Err(ExecError {
|
||||
error: Error::<Test>::ContractTrapped.into(),
|
||||
error: Error::<Test>::DuplicateTopics.into(),
|
||||
origin: ErrorOrigin::Caller,
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user