forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.rs
More file actions
25 lines (22 loc) · 745 Bytes
/
Copy pathevents.rs
File metadata and controls
25 lines (22 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! # Events Module for Split Template Contract
//!
//! Defines contract events emitted by the template management functions.
use soroban_sdk::{Address, Env, String, Symbol};
/// Emit an event when a template is created (includes schema version).
pub fn emit_template_created(
env: &Env,
template_id: String,
creator: Address,
name: String,
version: u32,
) {
env.events().publish(
(Symbol::new(env, "template_created"), template_id),
(creator, name, version),
);
}
/// Emit an event when a template is used to create a split.
pub fn emit_template_used(env: &Env, template_id: String, split_id: u64) {
env.events()
.publish((Symbol::new(env, "template_used"), template_id), split_id);
}