-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fd8ca7
commit 7cd071b
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
call :: bytes_hooks :: empty; | ||
return_value_to_arg; | ||
push "logEvent(Uint64,Uint64)"; | ||
call :: bytes_hooks :: append_str; | ||
return_value_to_arg; | ||
push 123_u64; | ||
call :: bytes_hooks :: append_u64; | ||
return_value_to_arg; | ||
push 555_u64; | ||
call :: bytes_hooks :: append_u64; | ||
return_value; | ||
mock CallData; | ||
|
||
call_contract 12345; | ||
return_value; | ||
check_eq (); | ||
|
||
push_status; | ||
check_eq 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![no_std] | ||
|
||
#[allow(unused_imports)] | ||
use ukm::*; | ||
|
||
#[ukm::contract] | ||
pub trait Events { | ||
#[event("MyEvent")] | ||
fn my_event(&self, #[indexed] from: u64, value: u64); | ||
|
||
#[init] | ||
fn init(&self) {} | ||
|
||
#[endpoint(logEvent)] | ||
fn log_event(&self, from:u64, value: u64) { | ||
self.my_event(from, value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
```k | ||
module UKM-PREPROCESSING-EVENTS | ||
imports private COMMON-K-CELL | ||
imports private RUST-PREPROCESSING-CONFIGURATION | ||
imports private UKM-PREPROCESSING-SYNTAX-PRIVATE | ||
rule | ||
<k> | ||
ukmPreprocessEvent | ||
(... fullMethodPath: Method:PathInExpression | ||
, eventName: _EventName:String | ||
) | ||
=> .K | ||
... | ||
</k> | ||
<method-name> Method </method-name> | ||
<method-implementation> | ||
empty => block({.InnerAttributes .NonEmptyStatements}) | ||
</method-implementation> | ||
<method-return-type> () </method-return-type> | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters