Skip to content

Commit

Permalink
set id in params
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed May 24, 2024
1 parent 8766260 commit b1a2f75
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/app-ofa-private/ofa-private.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ library DagStore {
address constant DAG_RETRIEVE = address(0); // TODO: fill in
address constant DAG_STORE = address(0); // TODO: fill in

function get(bytes32 dagId) public view returns (bytes memory) {
function get(bytes32 dagId) internal view returns (bytes memory) {
(bool success, bytes memory data) = DAG_RETRIEVE.call(abi.encode(dagId));
if (!success) {
revert PeekerReverted(DAG_RETRIEVE, data);
}
return data;
}

function set(bytes memory data) public returns (bytes32 dagId) {
bytes32 dagId = keccak256(data);
function set(bytes32 dagId, bytes memory data) internal {
(bool success, bytes memory data) = DAG_STORE.call(abi.encode(dagId, data));
if (!success) {
revert PeekerReverted(DAG_STORE, data);
}
return dagId;
}
}

Expand Down

0 comments on commit b1a2f75

Please sign in to comment.