Skip to content

Commit

Permalink
revert TasksSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Sep 27, 2024
1 parent a5570a8 commit c3253de
Showing 1 changed file with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.24;

import {System} from "@latticexyz/world/src/System.sol";
import {Tasks, TasksData} from "../codegen/index.sol";
import { System } from "@latticexyz/world/src/System.sol";
import { Tasks, TasksData } from "../codegen/index.sol";

contract TasksSystem is System {
event SomeEvent(string message);
function addTask(string memory description) public returns (bytes32 id) {
id = keccak256(abi.encode(block.prevrandao, _msgSender(), description));
Tasks.set(id, TasksData({ description: description, createdAt: block.timestamp, completedAt: 0 }));
}

function addTask(string memory description) public returns (bytes32 id) {
id = keccak256(abi.encode(block.prevrandao, _msgSender(), description));
Tasks.set(id, TasksData({description: description, createdAt: block.timestamp, completedAt: 0}));
function completeTask(bytes32 id) public {
Tasks.setCompletedAt(id, block.timestamp);
}

emit SomeEvent("addTask");
}
function resetTask(bytes32 id) public {
Tasks.setCompletedAt(id, 0);
}

function completeTask(bytes32 id) public {
Tasks.setCompletedAt(id, block.timestamp);
}

function resetTask(bytes32 id) public {
Tasks.setCompletedAt(id, 0);
}

function deleteTask(bytes32 id) public {
Tasks.deleteRecord(id);
}
function deleteTask(bytes32 id) public {
Tasks.deleteRecord(id);
}
}

0 comments on commit c3253de

Please sign in to comment.