Skip to content

Commit

Permalink
feat: support new contracts (#2184)
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh committed Mar 18, 2024
1 parent 3076d24 commit f0d7b6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions crates/chain-connector/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,10 @@ impl ChainConnector {
}

fn difficulty_params(&self) -> ArrayParams {
let data: String = Capacity::difficultyCall {}.abi_encode().encode_hex();
let data: String = Core::difficultyCall {}.abi_encode().encode_hex();

rpc_params![
json!({"data": data, "to": self.config.cc_contract_address}),
json!({"data": data, "to": self.config.core_contract_address}),
"latest"
]
}
Expand Down
2 changes: 0 additions & 2 deletions crates/chain-connector/src/function/capacity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ sol! {
/// @dev Capacity commitment is not active
error CapacityCommitmentIsNotActive(CCStatus status);

/// @dev Returns the difficulty for randomX
function difficulty() external view returns (bytes32);
function getGlobalNonce() external view returns (bytes32);

/// @dev Returns the min required randomX proofs per epoch for the 1 CU.
Expand Down
3 changes: 3 additions & 0 deletions crates/chain-connector/src/function/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ sol! {
/// @dev Returns epoch init timestamp
/// @return initTimestamp in seconds
function initTimestamp() external view returns (uint256);

/// @dev Returns the difficulty for CCP
function difficulty() external view returns (bytes32);
}
}

0 comments on commit f0d7b6e

Please sign in to comment.