Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion substrate/frame/revive/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub trait Ext: sealing::Sealed {
/// Returns `Err(InvalidImmutableAccess)` if called from a constructor.
fn get_immutable_data(&mut self) -> Result<ImmutableData, DispatchError>;

/// Set the the immutable data of the current contract.
/// Set the immutable data of the current contract.
///
/// Returns `Err(InvalidImmutableAccess)` if not called from a constructor.
///
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/src/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub struct RefTimeLeft(u64);

/// Resource that needs to be synced to the executor.
///
/// Wrapped to make sure that the resource will be synced back the the executor.
/// Wrapped to make sure that the resource will be synced back the executor.
#[must_use]
pub struct Syncable(polkavm::Gas);

Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub mod weights;

use crate::{
evm::{runtime::GAS_PRICE, GenericTransaction},
exec::{AccountIdOf, ExecError, Executable, Ext, Key, Origin, Stack as ExecStack},
exec::{AccountIdOf, ExecError, Executable, Ext, Key, Stack as ExecStack},
gas::GasMeter,
storage::{meter::Meter as StorageMeter, ContractInfo, DeletionQueueManager},
wasm::{CodeInfo, RuntimeCosts, WasmBlob},
Expand Down Expand Up @@ -81,7 +81,7 @@ use sp_runtime::{
pub use crate::{
address::{create1, create2, AccountId32Mapper, AddressMapper},
debug::Tracing,
exec::MomentOf,
exec::{MomentOf, Origin},
pallet::*,
};
pub use primitives::*;
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/uapi/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ pub trait HostFn: private::Sealed {
/// A return value of `true` indicates that this contract is being called by a root origin,
/// and `false` indicates that the caller is a signed origin.
#[unstable_hostfn]
fn caller_is_root() -> u32;
fn caller_is_root() -> bool;

/// Clear the value at the given key in the contract storage.
///
Expand Down
5 changes: 3 additions & 2 deletions substrate/frame/revive/uapi/src/host/riscv64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ impl HostFn for HostFnImpl {
}

#[unstable_hostfn]
fn caller_is_root() -> u32 {
unsafe { sys::caller_is_root() }.into_u32()
fn caller_is_root() -> bool {
let ret_val = unsafe { sys::caller_is_root() };
ret_val.into_bool()
}

#[unstable_hostfn]
Expand Down
Loading