Crate casper_event_standard
source ·Expand description
The smart contract level events for Casper.
use casper_event_standard::Event;
// Turn a struct into an event.
#[derive(Event)]
struct Transfer {
amount: U256,
from: Key,
to: Key
}
// Register event schemas.
fn init_events() {
let schemas = Schemas::new()
.with::<Transfer>();
casper_event_standard::init(schemas);
}
// Emit event.
fn emit_transfer(transfer: Transfer) {
casper_event_standard::emit(transfer);
}
Structs§
- A wrapper on top of
CLType
. - The information about a single event.
- The information about multiple events.
Constants§
- The version of CES implemented in this library.
- The key under which the ces version is stored.
- The key under which the events are stored.
- The key under which the events length is stored.
- The key under which the event schemas are stored.
Traits§
- Helper trait, used for the schema generation.
Functions§
- Emits an event.
- Emits an event. Don’t convert to bytes.
- Initializes events-releated named keys and stores
Schemas
. - Extracts full name of the event including
event_
prefix. - Make sure the type of a value is not
CLType::Any
.