Skip to content

Commit

Permalink
add helper-services
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Sep 7, 2023
1 parent bd5ea68 commit 367bde5
Show file tree
Hide file tree
Showing 9 changed files with 852 additions and 12 deletions.
6 changes: 5 additions & 1 deletion contracts/src/game/routes/StratagemsGameplay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ contract StratagemsGameplay is IStratagemsGameplay, UsingStratagemsSetters {
Commitment storage commitment = _commitments[msg.sender];
(uint24 epoch, ) = _epoch();

if (commitment.epoch == 0 || commitment.epoch == epoch) {
if (commitment.epoch == 0) {
revert NothingToResolve();
}

if (commitment.epoch == epoch) {
revert CanStillResolve();
}

Expand Down
14 changes: 9 additions & 5 deletions dev/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,32 @@ wezterm.on('gui-startup', function(cmd)
window:set_title 'stratagems'

local pane_indexer = pane:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm start:indexer; bash'},
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm indexer:dev; bash'},
direction = 'Bottom'
}
local pane_web = pane_indexer:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm start:web; bash'},
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm web:dev; bash'},
direction = 'Right'
}
local pane_common = pane_indexer:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm common:dev; bash'},
direction = 'Right'
}


local pane_local_node = pane:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm start:local_node; bash'},
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm local_node; bash'},
direction = 'Bottom'
}


local pane_contracts_compile = pane_local_node:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm start:contracts:compile; bash'},
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm contracts:compile:watch; bash'},
direction = 'Right'
}

local pane_contracts_deploy = pane_contracts_compile:split {
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm start:contracts:deploy; bash'},
args = {'bash', '-i', '-c', 'cd '.. cmd.args[1] .. '; sleep 1; pnpm contracts:deploy:watch; bash'},
direction = 'Bottom'
}

Expand Down
3 changes: 3 additions & 0 deletions helper-services/fuzd/.dev.vars.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CHAIN_0x7a69="http://127.0.0.1:8545#finality=2&worstCaseBlockTime=5"
HD_MNEMONIC="test test test test test test test test test test test junk"
TOKEN_ADMIN="random-token"
2 changes: 2 additions & 0 deletions helper-services/fuzd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.dev.vars
!.default
11 changes: 11 additions & 0 deletions helper-services/fuzd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "fuzd-service",
"devDependencies": {
"fuzd-cf-worker": "^0.0.3",
"wrangler": "^3.5.1"
},
"scripts": {
"fuzd": "wrangler dev -c ./wrangler.toml",
"wrangler": "wrangler"
}
}
21 changes: 21 additions & 0 deletions helper-services/fuzd/wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name = "fuzd-worker"
main = "node_modules/fuzd-cf-worker/src/index.ts"
compatibility_date = "2023-05-18"

[vars]

# The necessary secrets are:
# - HD_MNEMONIC
# - CHAIN_0x<CHAINID>
# see in .dev.vars.default
# Run `echo <VALUE> | wrangler secret put <NAME>` for each of these


[durable_objects]
bindings = [
{ name = "SCHEDULER", class_name = "SchedulerDO" }
]

[[migrations]]
tag = "v1"
new_classes = ["SchedulerDO"]
Loading

0 comments on commit 367bde5

Please sign in to comment.