-
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.
* publish deals event * activate deals * deal terminated * deal completed event * run CI * rustfmt * replace deal_id with id in market events
- Loading branch information
1 parent
688d404
commit 4b3eb90
Showing
12 changed files
with
227 additions
and
31 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,38 @@ | ||
use fil_actors_runtime::runtime::Runtime; | ||
use fil_actors_runtime::{ActorError, EventBuilder}; | ||
use fvm_shared::deal::DealID; | ||
use fvm_shared::ActorID; | ||
|
||
/// Indicates a deal has been published. | ||
pub fn deal_published( | ||
rt: &impl Runtime, | ||
client: ActorID, | ||
provider: ActorID, | ||
deal_id: DealID, | ||
) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new() | ||
.typ("deal-published") | ||
.field_indexed("client", &client) | ||
.field_indexed("provider", &provider) | ||
.field_indexed("id", &deal_id) | ||
.build()?, | ||
) | ||
} | ||
|
||
/// Indicates a deal has been activated. | ||
pub fn deal_activated(rt: &impl Runtime, deal_id: DealID) -> Result<(), ActorError> { | ||
rt.emit_event(&EventBuilder::new().typ("deal-activated").field_indexed("id", &deal_id).build()?) | ||
} | ||
|
||
/// Indicates a deal has been terminated. | ||
pub fn deal_terminated(rt: &impl Runtime, deal_id: DealID) -> Result<(), ActorError> { | ||
rt.emit_event( | ||
&EventBuilder::new().typ("deal-terminated").field_indexed("id", &deal_id).build()?, | ||
) | ||
} | ||
|
||
/// Indicates a deal has been completed successfully. | ||
pub fn deal_completed(rt: &impl Runtime, deal_id: DealID) -> Result<(), ActorError> { | ||
rt.emit_event(&EventBuilder::new().typ("deal-completed").field_indexed("id", &deal_id).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
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.