Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questplay MVP #11

Merged
merged 45 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
54e7143
Add @ng-quests package
bryanwee023 Aug 17, 2022
de1f214
Fix incorrect repo name
bryanwee023 Aug 17, 2022
0e5ca81
Fix landing page link
bryanwee023 Aug 17, 2022
1c933a7
Add tests for quest and quest find commands
bryanwee023 Aug 18, 2022
65c6820
Fix inconsistent indent size
bryanwee023 Aug 18, 2022
a8f4110
Change top level structure of directory.json to single array
bryanwee023 Aug 25, 2022
f257faf
Add
bryanwee023 Aug 26, 2022
86f8524
Tidy up code
bryanwee023 Aug 26, 2022
4acdc93
Add initial workflow draft
bryanwee023 Aug 26, 2022
807a8db
Fix CI tests for windows
bryanwee023 Aug 26, 2022
c95418d
Make test execution fail if comparison fails
bryanwee023 Aug 26, 2022
352a900
Add progress bar and navigation hint to CLI output
bryanwee023 Aug 30, 2022
04ee254
Add enforced order to
bryanwee023 Aug 30, 2022
7bb442e
Update CI tests to include check for quest type when running local tests
bryanwee023 Aug 30, 2022
1ad2e76
Update directory and packages
bryanwee023 Sep 21, 2022
4c1a4d4
Replace .credentials with .env
bryanwee023 Sep 21, 2022
908385e
Update runSolution to use .env
bryanwee023 Sep 22, 2022
2436f76
Fix unclear user instructions
bryanwee023 Oct 4, 2022
da79aaf
Automate npm install after every quest download
bryanwee023 Oct 4, 2022
d3132b1
Update quest directory and dependencies
bryanwee023 Oct 4, 2022
3df9db4
Update Github application link
bryanwee023 Oct 19, 2022
cc9828a
Abstract out progress bar
bryanwee023 Oct 27, 2022
818c936
Add quest submit command
bryanwee023 Oct 27, 2022
51fc75a
Remove stashing functionality
bryanwee023 Oct 27, 2022
252ccb5
Add help messages for quest submit
bryanwee023 Oct 27, 2022
8ed5efd
Fix undeclared currentBranch bug
bryanwee023 Oct 27, 2022
f324704
Fix set upstream bug
bryanwee023 Oct 27, 2022
94d1393
Fix typos in messages
bryanwee023 Oct 27, 2022
fc8e59a
Add CTF vs Build Quest check
bryanwee023 Oct 27, 2022
30760ad
Update @ngquests
bryanwee023 Oct 27, 2022
7486c2a
Update READM.md
bryanwee023 Oct 27, 2022
45bd0ae
Merge pull request #8 from Nodeguardians/feature/quest-submit
bryanwee023 Oct 27, 2022
2263745
Add quest update feature
bryanwee023 Nov 11, 2022
1267e66
Add update helper message
bryanwee023 Nov 11, 2022
30bba13
Add version check and commit
bryanwee023 Nov 11, 2022
bf30874
Update dependencies
bryanwee023 Nov 11, 2022
40bbc23
Add update reminder in quest find
bryanwee023 Nov 11, 2022
14194c0
Fix version check bug
bryanwee023 Nov 11, 2022
463a47e
Fix typos in messages
bryanwee023 Nov 11, 2022
5b9e6a8
Specify process success when exiting early
bryanwee023 Nov 11, 2022
1e7f925
Add auto-commit after update
bryanwee023 Nov 11, 2022
f53038e
Update expected output in tests
bryanwee023 Nov 11, 2022
cd76c64
Fix auto-commit bug
bryanwee023 Nov 12, 2022
28caf95
Merge pull request #10 from Nodeguardians/feature/quest-update
bryanwee023 Nov 12, 2022
777d26f
Update README.md
bryanwee023 Nov 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI Tests

on:
workflow_dispatch:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm link
- run: npm run test -- ${{ matrix.os }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.vscode
artifacts
cache
.credentials
.env
18 changes: 18 additions & 0 deletions @ngquests/contracts/IValidator.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

interface IValidator {

/// @dev Returns address of contract belonging to `user` in part `k` of quest.
function deployments(address user, uint k) external view returns (address);


/// @dev Deploys CTF contract for user to interact with.
function deploy(uint k) external;


/// @dev Tests whether contract belonging to `user` in part `k` has been "captured".
/// Returns true if contract "captured", false otherwise.
function test(address user, uint k) external view returns (bool);

}
48 changes: 48 additions & 0 deletions @ngquests/contracts/Token.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

/// @dev Test token with minting capabilities
/// Clone-friendly for cheaper gas in CTF quests
contract Token is ERC20 {

string private _name;
string private _symbol;

address private owner;
bool private isInitialized;

modifier onlyOwner() {
require(msg.sender == owner, "Caller is not owner");
_;
}

constructor() ERC20("", "") { }

function initialize(
string memory name_,
string memory symbol_
) external {
require(!isInitialized, "Token already initialized");

_name = name_;
_symbol = symbol_;

owner = msg.sender;
isInitialized = true;
}

function mint(address to, uint256 amount) external onlyOwner {
_mint(to, amount);
}

function name() public view override returns (string memory) {
return _name;
}

function symbol() public view override returns (string memory) {
return _symbol;
}

}
11 changes: 11 additions & 0 deletions @ngquests/contracts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@ngquests/contracts",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"No test specified\""
},
"author": "",
"license": "MIT"
}
7 changes: 7 additions & 0 deletions @ngquests/test-helpers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
get matchers () { return require('./src/matchers.js'); },
get events () { return require('./src/events.js'); },
get diamonds () { return require('./src/diamonds.js'); },
get ast () { return require('./src/ast.js'); },
get cheating () { return require('./src/cheating.js'); }
}
Loading