Skip to content

Commit

Permalink
nix flake commands updated
Browse files Browse the repository at this point in the history
  • Loading branch information
NanezX committed Nov 9, 2023
1 parent b095a3d commit 660e378
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 3 deletions.
61 changes: 61 additions & 0 deletions subgraph/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions subgraph/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@

in rec {
packages = rec {
concrete-contracts = ["AuthoringMetaGetter" "OrderBook" "RainterpreterExpressionDeployerNP" "RainterpreterNP" "RainterpreterStore"];
concrete-contracts = ["OrderBook" "RainterpreterExpressionDeployerNP" "RainterpreterNP" "RainterpreterStore"];

copy-abis = contract: ''
cp ../out/${contract}.sol/${contract}.json ./tests/generated/
cp ../out/${contract}.sol/${contract}.json ./test/generated/
'';

remove-duplicate-component = ''
# Remove a component duplicated on RainterpreterExpressionDeployerNP abi that conflict with abigen
contract_path="tests/generated/RainterpreterExpressionDeployerNP.json"
contract_path="test/generated/RainterpreterExpressionDeployerNP.json"
${jq} '.abi |= map(select(.name != "StackUnderflow"))' $contract_path > updated_contract.json
mv updated_contract.json $contract_path
'';

init-setup = pkgs.writeShellScriptBin "init-setup" (''
forge build --root ../
rm -rf ./abis ./test/generated
mkdir ./abis ./test/generated
cp ../out/OrderBook.sol/OrderBook.json ./abis/
cp ../out/ERC20.sol/ERC20.json ./abis/ERC20.json
'' + pkgs.lib.concatStrings (map copy-abis concrete-contracts)
Expand Down

0 comments on commit 660e378

Please sign in to comment.