-
Notifications
You must be signed in to change notification settings - Fork 79
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
6e5d70c
commit 9a22c67
Showing
7 changed files
with
180 additions
and
26 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,32 @@ | ||
// A namespace for helpers that build and emit provider Actor events. | ||
use fil_actors_runtime::runtime::Runtime; | ||
use fil_actors_runtime::{ActorError, EventBuilder}; | ||
use fvm_shared::sector::SectorNumber; | ||
|
||
/// Indicates a sector has been pre-committed. | ||
pub fn sector_precommitted(rt: &impl Runtime, sector: SectorNumber) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new().typ("sector-precommitted").field_indexed("sector", §or).build()?, | ||
) | ||
} | ||
|
||
/// Indicates a sector has been activated. | ||
pub fn sector_activated(rt: &impl Runtime, sector: SectorNumber) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new().typ("sector-activated").field_indexed("sector", §or).build()?, | ||
) | ||
} | ||
|
||
/// Indicates a sector has been updated. | ||
pub fn sector_updated(rt: &impl Runtime, sector: SectorNumber) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new().typ("sector-updated").field_indexed("sector", §or).build()?, | ||
) | ||
} | ||
|
||
/// Indicates a sector has been terminated. | ||
pub fn sector_terminated(rt: &impl Runtime, sector: SectorNumber) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new().typ("sector-terminated").field_indexed("sector", §or).build()?, | ||
) | ||
} |
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
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
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
Oops, something went wrong.