Skip to content

Commit 62023f4

Browse files
Create fee.rs
1 parent 5b0fcd7 commit 62023f4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/fee.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// Represents the context of a protocol-defined "use"
2+
#[derive(Debug, Clone)]
3+
pub struct UseContext {
4+
pub intent_id: String,
5+
pub from_state: String,
6+
pub to_state: String,
7+
pub timestamp_unix: u64,
8+
}
9+
10+
/// Represents a record that a usage event was registered
11+
#[derive(Debug, Clone)]
12+
pub struct FeeReceipt {
13+
pub context_hash: String,
14+
}
15+
16+
/// Abstract sink for recording protocol usage
17+
pub trait FeeSink {
18+
/// Record a single protocol-defined "use"
19+
fn record_use(&self, context: &UseContext) -> FeeReceipt;
20+
}

0 commit comments

Comments
 (0)