mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-30 01:27:26 +00:00
implement contract events (#2161)
* implement contract events * update runtime * renaming * update test code hash * improve complexity details * add deposit event base cost * add test * Revert "add deposit event base cost" This reverts commit 58ec010c0f4f4f0e16935ad41da32aedd17a8c57. * update test * Revert "update test" This reverts commit 6fe61a593ccf0d41f09a0b97472b28ed8751a999. * Revert "Revert "add deposit event base cost"" This reverts commit 145e8a9bac15313a4c380aa66b94fd4d36fa3f6d. * Fix format a bit
This commit is contained in:
@@ -89,7 +89,6 @@ pub trait Ext {
|
||||
/// Returns a reference to the account id of the current contract.
|
||||
fn address(&self) -> &AccountIdOf<Self::T>;
|
||||
|
||||
|
||||
/// Returns the balance of the current contract.
|
||||
///
|
||||
/// The `value_transferred` is already added.
|
||||
@@ -103,6 +102,9 @@ pub trait Ext {
|
||||
|
||||
/// Returns a reference to the random seed for the current block
|
||||
fn random_seed(&self) -> &SeedOf<Self::T>;
|
||||
|
||||
/// Deposit an event.
|
||||
fn deposit_event(&mut self, data: Vec<u8>);
|
||||
}
|
||||
|
||||
/// Loader is a companion of the `Vm` trait. It loads an appropriate abstract
|
||||
@@ -617,6 +619,10 @@ where
|
||||
fn now(&self) -> &T::Moment {
|
||||
&self.timestamp
|
||||
}
|
||||
|
||||
fn deposit_event(&mut self, data: Vec<u8>) {
|
||||
self.ctx.events.push(RawEvent::Contract(self.ctx.self_account.clone(), data));
|
||||
}
|
||||
}
|
||||
|
||||
/// These tests exercise the executive layer.
|
||||
|
||||
Reference in New Issue
Block a user