Skip to content

Commit

Permalink
Merge branch 'main' into terminus-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zomglings authored Aug 21, 2023
2 parents 08ff188 + 4c82726 commit 78b63c0
Show file tree
Hide file tree
Showing 10 changed files with 2,104 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/statblock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: StatBlock tests

on:
pull_request:
paths:
- "contracts/stats/**"
- "cli/web3cli/test_statblock.py"
- "cli/web3cli/StatBlock.py"
- "cli/web3cli/IStatBlock.py"
- "cli/web3cli/statblock_events.py"
- ".github/workflows/statblock.yml"
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install ganache
run: npm install -g ganache-cli
- name: Upgrade pip
env:
BROWNIE_LIB: 1
run: pip install -U pip
- name: Install additional dev dependencies
run: |
pip install black moonworm
- name: Install dependencies for CLI
working-directory: cli/
env:
BROWNIE_LIB: 1
run: |
pip install -e .
- name: Run tests
working-directory: cli/
run: bash test.sh web3cli.test_statblock
267 changes: 267 additions & 0 deletions abi/IStatBlock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenID",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "statID",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "StatAssigned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "statID",
"type": "uint256"
}
],
"name": "StatCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "statID",
"type": "uint256"
},
{
"indexed": false,
"internalType": "string",
"name": "descriptor",
"type": "string"
}
],
"name": "StatDescriptorUpdated",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenID",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "statIDs",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
}
],
"name": "assignStats",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "tokenAddresses",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "tokenIDs",
"type": "uint256[]"
},
{
"internalType": "uint256[][]",
"name": "statIDs",
"type": "uint256[][]"
},
{
"internalType": "uint256[][]",
"name": "values",
"type": "uint256[][]"
}
],
"name": "batchAssignStats",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "tokenAddresses",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "tokenIDs",
"type": "uint256[]"
},
{
"internalType": "uint256[]",
"name": "statIDs",
"type": "uint256[]"
}
],
"name": "batchGetStats",
"outputs": [
{
"internalType": "uint256[][]",
"name": "",
"type": "uint256[][]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "descriptor",
"type": "string"
}
],
"name": "createStat",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "describeStat",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenID",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "statIDs",
"type": "uint256[]"
}
],
"name": "getStats",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "isAdministrator",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "statID",
"type": "uint256"
},
{
"internalType": "string",
"name": "descriptor",
"type": "string"
}
],
"name": "setStatDescriptor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "statBlockVersion",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
]
Loading

0 comments on commit 78b63c0

Please sign in to comment.