Skip to content

Commit

Permalink
add getId methods for oracle and product
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaszimmermann committed Mar 16, 2022
1 parent 59cb09d commit ad39e76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract contract Oracle is IOracle, RBAC {
IOracleService public oracleService;
IOracleOwnerService public oracleOwnerService;
IRegistryAccess public registryAccess;
uint256 public oracleId;

modifier onlyQuery {
require(
Expand All @@ -31,10 +32,12 @@ abstract contract Oracle is IOracle, RBAC {
oracleOwnerService = IOracleOwnerService(_oracleOwnerService);
registryAccess = IRegistryAccess(_oracleService);

uint256 oracleId = oracleOwnerService.proposeOracle(_oracleName);
oracleId = oracleOwnerService.proposeOracle(_oracleName);
oracleOwnerService.proposeOracleToOracleType(_oracleTypeName, oracleId);
}

function getId() public view returns(uint256) { return oracleId; }

function _respond(uint256 _requestId, bytes memory _data) internal {
oracleService.respond(_requestId, _data);
}
Expand Down
2 changes: 2 additions & 0 deletions contracts/Product.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ abstract contract Product is RBAC {
productId = _proposeProduct(_name, _policyFlow);
}

function getId() public view returns(uint256) { return productId; }

function setDevelopmentMode(bool _newMode) internal {
developmentMode = _newMode;
}
Expand Down

0 comments on commit ad39e76

Please sign in to comment.