Search
 
SCRIPT & CODE EXAMPLE
 

RUST

armanriazi•substrate•call•dispatchable•func#ensure_signed#frame_system

///ensure_signed
///ensure that the caller of the function was a regular user who owns a private key. This function also returns who that caller was. We store the caller's identity in the caller variable.
/// Ensure that the caller is a regular keypair account

pub fn say_hello(origin) -> DispatchResult {
    // Ensure that the caller is a regular keypair account
    let caller = ensure_signed(origin)?;

    // Print a message
    print("Hello World");
    // Inspecting variables
    debug::info!("Request sent by: {:?}", caller);

    // Indicate that this call succeeded
    Ok(())
}
Comment

PREVIOUS NEXT
Code Example
Rust :: armanriazi•rust•thread•rayon•join•workstealing 
Rust :: armanriazi•rust•binding•match 
Rust :: armanriazi•rust•trait•object•safe 
Rust :: armanriazi•rust•error•E0277•the trait bound `` is not satisfied 
Rust :: create a rust project Inside the folder 
Rust :: rust array literal 
Rust :: rust match enum 
Lua :: roblox studio teleport on touch 
Lua :: roblox jsonencode 
Lua :: sleep function lua 
Lua :: roblox make kill brick 
Lua :: roblox get player by name 
Lua :: my second long scripting 
Lua :: roblox studio color randomizer 
Lua :: lua gsub 
Lua :: repeat until lua 
Lua :: for loop roblox 
Lua :: lua tables 
Lua :: how to end if statement roblox 
Lua :: How to Register a command in Lua 
Lua :: lua how to make a click button 
Lua :: Ackermann function lua 
Lua :: roblox can I have player animations on the server 
Matlab :: transfer function get num and den matlab 
Matlab :: matlab variables 
Basic :: add user to multiple groups ubuntu 
Basic :: como colocar aspas duplas em vbnet 
Elixir :: elixir enum each 
Elixir :: elixir error 
Scala :: scala named function 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =