-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chain-listener): exit expired deals (#2143)
* feat(chain-listener): exit expired deals * update * fix * fix * fix * fix * subscribe to unit events on start * don't send exit tx for ended deals * fix unit deactivation * exit on deal ended * resubscribe on subscription termination * log message from newHeads subs * fix
- Loading branch information
Showing
30 changed files
with
669 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use chain_data::ChainFunction; | ||
use ethabi::ParamType; | ||
|
||
/// function getStatus() public view returns (Status) | ||
pub struct GetDealStatusFunction; | ||
|
||
impl ChainFunction for GetDealStatusFunction { | ||
fn function() -> ethabi::Function { | ||
#[allow(deprecated)] | ||
let function = ethabi::Function { | ||
name: "getStatus".to_string(), | ||
inputs: vec![], | ||
outputs: vec![], | ||
constant: None, | ||
state_mutability: ethabi::StateMutability::View, | ||
}; | ||
function | ||
} | ||
|
||
fn result_signature() -> Vec<ParamType> { | ||
vec![ParamType::FixedBytes(32)] | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
crates/chain-connector/src/function/remove_cu_from_deal.rs
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,27 @@ | ||
use chain_data::ChainFunction; | ||
use ethabi::{Function, Param, ParamType, StateMutability}; | ||
|
||
/// @dev Return the compute unit from a deal | ||
/// function returnComputeUnitFromDeal(bytes32 unitId) external; | ||
pub struct ReturnComputeUnitFromDeal; | ||
|
||
impl ChainFunction for ReturnComputeUnitFromDeal { | ||
fn function() -> Function { | ||
#[allow(deprecated)] | ||
Function { | ||
name: "returnComputeUnitFromDeal".to_string(), | ||
inputs: vec![Param { | ||
name: "unitId".to_string(), | ||
kind: ParamType::FixedBytes(32), | ||
internal_type: None, | ||
}], | ||
outputs: vec![], | ||
constant: None, | ||
state_mutability: StateMutability::NonPayable, | ||
} | ||
} | ||
|
||
fn result_signature() -> Vec<ParamType> { | ||
vec![] | ||
} | ||
} |
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.