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

Feat: added chain IDs to injected parameters #50

Merged
merged 3 commits into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-class-properties"
],
"sourceMaps": "inline",
"sourceMap": "inline",
"env": {
"test": {
"presets": ["@babel/preset-env"]
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/_build/
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/react",
"plugin:prettier/recommended"
],
"plugins": [
"prettier",
"import"
],
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)",
"argsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)"
}
],
"no-console": [
"error",
{
"allow": [
"warn",
"error",
"info",
"debug"
]
}
]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Dependencies
.eslintcache
node_modules/

# Testing
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"**/*.{json,html,svg,md}": "prettier --write --ignore-unknown",
"**/*.js": [
"prettier --write",
"eslint --fix"
]
}
13 changes: 13 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 120,
"overrides": [
{
"files": [
"*.json"
],
"options": {
"parser": "json-stringify"
}
}
]
}
Binary file modified docs/_build/doctrees/archon-arbitrable.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/archon-utils-validation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/archon-utils.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
10 changes: 6 additions & 4 deletions docs/_build/html/_sources/archon-arbitrable.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ The options parameter can include:
============ ====== ======================================================
Key Type Description
============ ====== ======================================================
strictHashes bool If true, an error will throw if hash validations fail.
strict bool If true, an error will throw if hash or chain ID validations fail.
strictHashes bool [DEPRECATED] If true, an error will throw if hash validations fail.
customHashFn fn Hashing function that should be used to validate the hashes.
fromBlock int The block where we start searching for event logs.
toBlock int The block where we will stop searching for event logs.
Expand Down Expand Up @@ -84,7 +85,7 @@ Example
"0x211f01e59b425253c0a0e9a7bf612605b42ce82c", // arbitrator contract address
1, // dispute ID
{
strictHashes: true
strict: true
}
).then(data => {
console.log(data)
Expand Down Expand Up @@ -140,7 +141,8 @@ The options parameter can include:
================ ====== ======================================================
Key Type Description
================ ====== ======================================================
strictHashes bool If true, an error will throw if hash validations fail.
strict bool If true, an error will throw if hash or chain ID validations fail.
strictHashes bool [DEPRECATED] If true, an error will throw if hash validations fail.
customHashFn fn Hashing function that should be used to validate the hashes.
fromBlock int The block where we start searching for event logs.
toBlock int The block where we will stop searching for event logs.
Expand Down Expand Up @@ -182,7 +184,7 @@ Example
'0x91697c78d48e9c83b71727ddd41ccdc95bb2f012',
1,
{
strictHashes: false
strict: false
}
).then(data => {
console.log(data)
Expand Down
3 changes: 2 additions & 1 deletion docs/_build/html/_sources/archon-utils-validation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Key Type Description
============ ====== ================================================================================
preValidated bool If file has been pre-validated this will just fetch file and set isValid = true.
hash string The original hash to compare the file against.
strictHashes bool If true, an error will throw if hash validations fail.
strict bool If true, an error will throw if hash or chain ID validations fail.
strictHashes bool [DEPRECATED] If true, an error will throw if hash validations fail.
customHashFn fn A custom hash function to use to validate the file.
============ ====== ================================================================================

Expand Down
48 changes: 28 additions & 20 deletions docs/_build/html/archon-arbitrable.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ <h3>Parameters<a class="headerlink" href="#parameters" title="Permalink to this
<p>The options parameter can include:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 8%" />
<col style="width: 77%" />
<col style="width: 14%" />
<col style="width: 7%" />
<col style="width: 79%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Key</p></th>
Expand All @@ -84,23 +84,27 @@ <h3>Parameters<a class="headerlink" href="#parameters" title="Permalink to this
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>strictHashes</p></td>
<tr class="row-even"><td><p>strict</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash or chain ID validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>strictHashes</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash validations fail.</p></td>
<td><p>[DEPRECATED] If true, an error will throw if hash validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>customHashFn</p></td>
<tr class="row-even"><td><p>customHashFn</p></td>
<td><p>fn</p></td>
<td><p>Hashing function that should be used to validate the hashes.</p></td>
</tr>
<tr class="row-even"><td><p>fromBlock</p></td>
<tr class="row-odd"><td><p>fromBlock</p></td>
<td><p>int</p></td>
<td><p>The block where we start searching for event logs.</p></td>
</tr>
<tr class="row-odd"><td><p>toBlock</p></td>
<tr class="row-even"><td><p>toBlock</p></td>
<td><p>int</p></td>
<td><p>The block where we will stop searching for event logs.</p></td>
</tr>
<tr class="row-even"><td><p>filters</p></td>
<tr class="row-odd"><td><p>filters</p></td>
<td><p>object</p></td>
<td><p>Additional filters for event logs.</p></td>
</tr>
Expand Down Expand Up @@ -134,7 +138,7 @@ <h3>Example<a class="headerlink" href="#example" title="Permalink to this headli
<span class="s2">&quot;0x211f01e59b425253c0a0e9a7bf612605b42ce82c&quot;</span><span class="p">,</span> <span class="c1">// arbitrator contract address</span>
<span class="mf">1</span><span class="p">,</span> <span class="c1">// dispute ID</span>
<span class="p">{</span>
<span class="nx">strictHashes</span><span class="o">:</span> <span class="kc">true</span>
<span class="nx">strict</span><span class="o">:</span> <span class="kc">true</span>
<span class="p">}</span>
<span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">data</span> <span class="p">=&gt;</span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span>
Expand Down Expand Up @@ -186,9 +190,9 @@ <h3>Parameters<a class="headerlink" href="#id2" title="Permalink to this headlin
<p>The options parameter can include:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 20%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 73%" />
<col style="width: 75%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Key</p></th>
Expand All @@ -197,27 +201,31 @@ <h3>Parameters<a class="headerlink" href="#id2" title="Permalink to this headlin
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>strictHashes</p></td>
<tr class="row-even"><td><p>strict</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash or chain ID validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>strictHashes</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash validations fail.</p></td>
<td><p>[DEPRECATED] If true, an error will throw if hash validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>customHashFn</p></td>
<tr class="row-even"><td><p>customHashFn</p></td>
<td><p>fn</p></td>
<td><p>Hashing function that should be used to validate the hashes.</p></td>
</tr>
<tr class="row-even"><td><p>fromBlock</p></td>
<tr class="row-odd"><td><p>fromBlock</p></td>
<td><p>int</p></td>
<td><p>The block where we start searching for event logs.</p></td>
</tr>
<tr class="row-odd"><td><p>toBlock</p></td>
<tr class="row-even"><td><p>toBlock</p></td>
<td><p>int</p></td>
<td><p>The block where we will stop searching for event logs.</p></td>
</tr>
<tr class="row-even"><td><p>filters</p></td>
<tr class="row-odd"><td><p>filters</p></td>
<td><p>object</p></td>
<td><p>Additional filters for event logs.</p></td>
</tr>
<tr class="row-odd"><td><p>scriptParameters</p></td>
<tr class="row-even"><td><p>scriptParameters</p></td>
<td><p>object</p></td>
<td><p>Parameters to pass to sandboxed script.</p></td>
</tr>
Expand Down Expand Up @@ -257,7 +265,7 @@ <h3>Example<a class="headerlink" href="#id4" title="Permalink to this headline">
<span class="s1">&#39;0x91697c78d48e9c83b71727ddd41ccdc95bb2f012&#39;</span><span class="p">,</span>
<span class="mf">1</span><span class="p">,</span>
<span class="p">{</span>
<span class="nx">strictHashes</span><span class="o">:</span> <span class="kc">false</span>
<span class="nx">strict</span><span class="o">:</span> <span class="kc">false</span>
<span class="p">}</span>
<span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">data</span> <span class="p">=&gt;</span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span>
Expand Down
10 changes: 7 additions & 3 deletions docs/_build/html/archon-utils-validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@ <h2>Parameters<a class="headerlink" href="#parameters" title="Permalink to this
<td><p>string</p></td>
<td><p>The original hash to compare the file against.</p></td>
</tr>
<tr class="row-even"><td><p>strictHashes</p></td>
<tr class="row-even"><td><p>strict</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash validations fail.</p></td>
<td><p>If true, an error will throw if hash or chain ID validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>customHashFn</p></td>
<tr class="row-odd"><td><p>strictHashes</p></td>
<td><p>bool</p></td>
<td><p>[DEPRECATED] If true, an error will throw if hash validations fail.</p></td>
</tr>
<tr class="row-even"><td><p>customHashFn</p></td>
<td><p>fn</p></td>
<td><p>A custom hash function to use to validate the file.</p></td>
</tr>
Expand Down
10 changes: 7 additions & 3 deletions docs/_build/html/archon-utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ <h3>Parameters<a class="headerlink" href="#parameters" title="Permalink to this
<td><p>string</p></td>
<td><p>The original hash to compare the file against.</p></td>
</tr>
<tr class="row-even"><td><p>strictHashes</p></td>
<tr class="row-even"><td><p>strict</p></td>
<td><p>bool</p></td>
<td><p>If true, an error will throw if hash validations fail.</p></td>
<td><p>If true, an error will throw if hash or chain ID validations fail.</p></td>
</tr>
<tr class="row-odd"><td><p>customHashFn</p></td>
<tr class="row-odd"><td><p>strictHashes</p></td>
<td><p>bool</p></td>
<td><p>[DEPRECATED] If true, an error will throw if hash validations fail.</p></td>
</tr>
<tr class="row-even"><td><p>customHashFn</p></td>
<td><p>fn</p></td>
<td><p>A custom hash function to use to validate the file.</p></td>
</tr>
Expand Down
Loading