Skip to content

Commit 1bb816d

Browse files
authored
Update dependencies + run Prettier (#149)
1 parent 9f66a9a commit 1bb816d

20 files changed

+1371
-1402
lines changed

crowdin.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ files:
44
translation: /pages/%two_letters_code%/**/%original_file_name%
55
dest: /**/%original_file_name%
66
content_segmentation: 0
7-
skip_untranslated_files: true
87
- source: /pages/en/**/*.json
98
translation: /pages/%two_letters_code%/**/%original_file_name%
109
dest: /**/%original_file_name%
1110
content_segmentation: 0
12-
skip_untranslated_strings: true

navigation/navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const navigation: (locale: AppLocale) => NavItemDefinition[] = (locale) =
9494
slug: 'billing',
9595
},
9696
{
97-
slug: 'managing-api-keys'
97+
slug: 'managing-api-keys',
9898
},
9999
{
100100
slug: 'studio-faq',

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"docker:up": "docker run --rm -it -p 3000:80 -v \"$(pwd)/nginx.conf:/etc/nginx/nginx.conf\" docs"
1818
},
1919
"dependencies": {
20-
"@docsearch/react": "^3.0.0",
21-
"@edgeandnode/components": "^22.3.4",
22-
"@emotion/react": "^11.9.0",
20+
"@docsearch/react": "^3.1.0",
21+
"@edgeandnode/components": "^22.7.4",
22+
"@emotion/react": "^11.9.3",
2323
"@mdx-js/loader": "^2.1.1",
2424
"@mdx-js/react": "^2.1.1",
2525
"@next/mdx": "^12.1.6",
@@ -28,41 +28,41 @@
2828
"@radix-ui/react-visually-hidden": "^0.1.4",
2929
"next": "^12.1.6",
3030
"next-seo": "^5.4.0",
31-
"prism-react-renderer": "^1.3.1",
31+
"prism-react-renderer": "^1.3.3",
3232
"react": "^17.0.2",
3333
"react-dom": "^17.0.2",
34-
"react-intersection-observer": "^9.1.0",
35-
"react-use": "^17.3.2",
34+
"react-intersection-observer": "^9.3.3",
35+
"react-use": "^17.4.0",
3636
"remark-gfm": "^3.0.1",
3737
"theme-ui": "^0.12.1",
38-
"use-bus": "^2.5.0"
38+
"use-bus": "^2.5.1"
3939
},
4040
"devDependencies": {
4141
"@sindresorhus/slugify": "^2.1.0",
4242
"@svgr/webpack": "^6.2.1",
4343
"@types/color": "^3.0.3",
4444
"@types/lodash-es": "^4.17.6",
45-
"@types/node": "^16.11.33",
46-
"@types/react": "^17.0.44",
47-
"@types/react-dom": "^17.0.16",
45+
"@types/node": "^16.11.41",
46+
"@types/react": "^17.0.45",
47+
"@types/react-dom": "^17.0.17",
4848
"acorn": "^8.7.1",
4949
"acorn-jsx": "^5.3.2",
50-
"eslint": "^8.14.0",
50+
"eslint": "^8.17.0",
5151
"eslint-config-next": "^12.1.6",
5252
"husky": "^7.0.4",
5353
"lodash-es": "^4.17.21",
5454
"path": "^0.12.7",
55-
"prettier": "^2.6.2",
55+
"prettier": "^2.7.0",
5656
"remark-frontmatter": "^4.0.1",
5757
"remark-mdx-frontmatter": "^1.1.1",
5858
"serialize-as-code": "^2.0.2",
59-
"typescript": "4.6.4",
59+
"typescript": "4.7.3",
6060
"unist-util-visit": "^4.1.0",
6161
"url": "^0.11.0"
6262
},
6363
"resolutions": {
64-
"@types/react": "^17.0.44",
65-
"@types/react-dom": "^17.0.16"
64+
"@types/react": "^17.0.45",
65+
"@types/react-dom": "^17.0.17"
6666
},
6767
"engines": {
6868
"node": ">=16"

pages/en/delegating.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ Imagine an Indexer has 100,000,000 GRT delegated to them, and their capacity is
8383

8484
Therefore a Delegator should always consider the Delegation Capacity of an Indexer, and factor it into their decision making.
8585

86-
## Delegator FAQs and Bugs
86+
## Delegator FAQs and Bugs
8787

8888
### MetaMask "Pending Transaction" Bug
8989

9090
**When I try to delegate my transaction in MetaMask appears as "Pending" or "Queued" for longer than expected. What should I do?**
9191

92-
At times, attempts to delegate to indexers via MetaMask can fail and result in prolonged periods of "Pending" or "Queued" transaction attempts. For example, a user may attempt to delegate with an insufficient gas fee relative to the current prices, resulting in the transaction attempt displaying as "Pending" in their MetaMask wallet for 15+ minutes. When this occurs, subsequent transactions can be attempted by a user, but these will not be processed until the initial transaction is mined, as transactions for an address must be processed in order. In such cases, these transactions can be cancelled in MetaMask, but the transactions attempts will accrue gas fees without any guarantee that subsequent attempts will be successful. A simpler resolution to this bug is restarting the browsesr (e.g., using "abort:restart" in the address bar), which will cancel all previous attempts without gas being subtracted from the wallet. Several users that have encountered this issue and have reported successful transactions after restarting their browser and attempting to delegate.
92+
At times, attempts to delegate to indexers via MetaMask can fail and result in prolonged periods of "Pending" or "Queued" transaction attempts. For example, a user may attempt to delegate with an insufficient gas fee relative to the current prices, resulting in the transaction attempt displaying as "Pending" in their MetaMask wallet for 15+ minutes. When this occurs, subsequent transactions can be attempted by a user, but these will not be processed until the initial transaction is mined, as transactions for an address must be processed in order. In such cases, these transactions can be cancelled in MetaMask, but the transactions attempts will accrue gas fees without any guarantee that subsequent attempts will be successful. A simpler resolution to this bug is restarting the browsesr (e.g., using "abort:restart" in the address bar), which will cancel all previous attempts without gas being subtracted from the wallet. Several users that have encountered this issue and have reported successful transactions after restarting their browser and attempting to delegate.
9393

9494
## Video guide for the network UI
9595

pages/en/developer/assemblyscript-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The `apiVersion` in the subgraph manifest specifies the mapping API version whic
4545

4646
| Version | Release notes |
4747
| :-: | --- |
48-
| 0.0.7 | Added `TransactionReceipt` and `Log` classes to the Ethereum types<br />Added `receipt` field to the Ethereum Event object|
48+
| 0.0.7 | Added `TransactionReceipt` and `Log` classes to the Ethereum types<br />Added `receipt` field to the Ethereum Event object |
4949
| 0.0.6 | Added `nonce` field to the Ethereum Transaction object<br />Added `baseFeePerGas` to the Ethereum Block object |
5050
| 0.0.5 | AssemblyScript upgraded to version 0.19.10 (this includes breaking changes, please see the [`Migration Guide`](/developer/assemblyscript-migration-guide))<br />`ethereum.transaction.gasUsed` renamed to `ethereum.transaction.gasLimit` |
5151
| 0.0.4 | Added `functionSignature` field to the Ethereum SmartContractCall object |
@@ -420,7 +420,7 @@ class TransactionReceipt {
420420
status: BigInt
421421
root: Bytes
422422
logsBloom: Bytes
423-
}
423+
}
424424

425425
class Log {
426426
address: Address

pages/en/developer/create-subgraph-hosted.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ The schema for your subgraph is in the file `schema.graphql`. GraphQL schemas ar
168168

169169
Before defining entities, it is important to take a step back and think about how your data is structured and linked. All queries will be made against the data model defined in the subgraph schema and the entities indexed by the subgraph. Because of this, it is good to define the subgraph schema in a way that matches the needs of your dapp. It may be useful to imagine entities as "objects containing data", rather than as events or functions.
170170

171-
172171
With The Graph, you simply define entity types in `schema.graphql`, and Graph Node will generate top level fields for querying single instances and collections of that entity type. Each type that should be an entity is required to be annotated with an `@entity` directive. By default, entities are mutable, meaning that mappings can load existing entities, modify them and store a new version of that entity. Mutability comes at a price, and for entity types for which it is known that they will never be modified, for example, because they simply contain data extracted verbatim from the chain, it is recommended to mark them as immutable with `@entity(immutable: true)`. Mappings can make changes to immutable entities as long as those changes happen in the same block in which the entity was created. Immutable entities are much faster to write and to query, and should therefore be used whenever possible.
173172

174173
### Good Example
@@ -444,7 +443,7 @@ Supported language dictionaries:
444443
| hu | Hungarian |
445444
| it | Italian |
446445
| no | Norwegian |
447-
| pt | Portuguese |
446+
| pt | Portuguese |
448447
| ro | Romanian |
449448
| ru | Russian |
450449
| es | Spanish |
@@ -831,7 +830,6 @@ eventHandlers:
831830

832831
Inside the handler function, the receipt can be accessed in the `Event.receipt` field. When the `receipt` key is set to `false` or omitted in the manifest, a `null` value will be returned instead.
833832

834-
835833
## Experimental features
836834

837835
Starting from `specVersion` `0.0.4`, subgraph features must be explicitly declared in the `features` section at the top level of the manifest file, using their `camelCase` name, as listed in the table below:

pages/en/developer/graphql-api.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ This can be useful if you are looking to fetch only entities which have changed,
142142

143143
```graphql
144144
{
145-
applications(where: { _change_block: { number_gte: 100 }}) {
145+
applications(where: { _change_block: { number_gte: 100 } }) {
146146
id
147147
whitelisted
148148
deposit
@@ -184,7 +184,6 @@ In addition, the following global filters are available as part of `where` argum
184184
_change_block(number_gte: Int)
185185
```
186186

187-
188187
### Time-travel queries
189188

190189
You can query the state of your entities not just for the latest block, which is the by default, but also for an arbitrary block in the past. The block at which a query should happen can be specified either by its block number or its block hash by including a `block` argument in the toplevel fields of queries.

pages/en/developer/matchstick.mdx

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,27 @@ sudo apt install postgresql
3333
```
3434

3535
### WSL (Windows Subsystem for Linux)
36-
You can use Matchstick on WSL both using the Docker approach and the binary approach. As WSL can be a bit tricky, here's a few tips in case you encounter issues like
36+
37+
You can use Matchstick on WSL both using the Docker approach and the binary approach. As WSL can be a bit tricky, here's a few tips in case you encounter issues like
38+
3739
```
3840
static BYTES = Symbol("Bytes") SyntaxError: Unexpected token =
39-
```
40-
or
41+
```
42+
43+
or
44+
4145
```
4246
<PROJECT_PATH>/node_modules/gluegun/build/index.js:13 throw up;
4347
```
4448

45-
Please make sure you're on a newer version of Node.js graph-cli doesn't support **v10.19.0** anymore, and that is still the default version for new Ubuntu images on WSL. For instance Matchstick is confirmed to be working on WSL with **v18.1.0**, you can switch to it either via **nvm** or if you update your global Node.js.
46-
Don't forget to delete `node_modules` and to run `npm install` again after updating you nodejs!
47-
Then, make sure you have **libpq** installed, you can do that by running
49+
Please make sure you're on a newer version of Node.js graph-cli doesn't support **v10.19.0** anymore, and that is still the default version for new Ubuntu images on WSL. For instance Matchstick is confirmed to be working on WSL with **v18.1.0**, you can switch to it either via **nvm** or if you update your global Node.js. Don't forget to delete `node_modules` and to run `npm install` again after updating you nodejs! Then, make sure you have **libpq** installed, you can do that by running
50+
4851
```
4952
sudo apt-get install libpq-dev
50-
```
51-
And finally, do not use `graph test` (which uses your global installation of graph-cli and for some reason that looks like it's broken on WSL currently), instead use `yarn test` or `npm run test` (that will use the local, project-level instance of graph-cli, which works like a charm. For that you would of course need to have a `"test"` script in your `package.json` file which can be something as simple as
53+
```
54+
55+
And finally, do not use `graph test` (which uses your global installation of graph-cli and for some reason that looks like it's broken on WSL currently), instead use `yarn test` or `npm run test` (that will use the local, project-level instance of graph-cli, which works like a charm. For that you would of course need to have a `"test"` script in your `package.json` file which can be something as simple as
56+
5257
```json
5358
{
5459
"name": "demo-subgraph",
@@ -67,26 +72,30 @@ And finally, do not use `graph test` (which uses your global installation of gra
6772

6873
### Usage
6974

70-
To use **Matchstick** in your subgraph project just open up a terminal, navigate to the root folder of your project and simply run `graph test [options] <datasource>` - it downloads the latest **Matchstick** binary and runs the specified test or all tests in a test folder (or all existing tests if no datasource flag is specified).
75+
To use **Matchstick** in your subgraph project just open up a terminal, navigate to the root folder of your project and simply run `graph test [options] <datasource>` - it downloads the latest **Matchstick** binary and runs the specified test or all tests in a test folder (or all existing tests if no datasource flag is specified).
7176

7277
### CLI options
7378

7479
This will run all tests in the test folder:
80+
7581
```sh
7682
graph test
7783
```
7884

7985
This will run a test named gravity.test.ts and/or all test inside of a folder named gravity:
86+
8087
```sh
81-
graph test gravity
88+
graph test gravity
8289
```
8390

8491
This will run only that specific test file:
92+
8593
```sh
8694
graph test path/to/file.test.ts
8795
```
8896

8997
**Options:**
98+
9099
```sh
91100
-c, --coverage Run the tests in coverage mode
92101
-d, --docker Run the tests in a docker container (Note: Please execute from the root folder of the subgraph)
@@ -172,7 +181,8 @@ describe("handleUpdatedGravatar()", () => {
172181
})
173182
})
174183
```
175-
__________________________________________________________________
184+
185+
---
176186

177187
### test()
178188

@@ -200,15 +210,16 @@ test("handleNewGravatar() should create a new entity", () => {
200210
201211
202212
```
203-
__________________________________________________________________
213+
214+
---
204215

205216
### beforeAll()
206217

207218
Runs a code block before any of the tests in the file. If `beforeAll` is declared inside of a `describe` block, it runs at the beginning of that `describe` block.
208219

209220
Examples:
210221

211-
Code inside `beforeAll` will execute once before *all* tests in the file.
222+
Code inside `beforeAll` will execute once before _all_ tests in the file.
212223

213224
```typescript
214225
import { describe, test, beforeAll } from "matchstick-as/assembly/index"
@@ -259,15 +270,16 @@ describe("handleUpdatedGravatar()", () => {
259270
})
260271
})
261272
```
262-
__________________________________________________________________
273+
274+
---
263275

264276
### afterAll()
265277

266278
Runs a code block after all of the tests in the file. If `afterAll` is declared inside of a `describe` block, it runs at the end of that `describe` block.
267279

268280
Example:
269281

270-
Code inside `afterAll` will execute once after *all* tests in the file.
282+
Code inside `afterAll` will execute once after _all_ tests in the file.
271283

272284
```typescript
273285
import { describe, test, afterAll } from "matchstick-as/assembly/index"
@@ -316,17 +328,17 @@ describe("handleNewGravatar", () => {
316328
describe("handleUpdatedGravatar", () => {
317329
test("updates Gravatar with id 0x0", () => {
318330
...
319-
})
331+
})
320332
})
321333
```
322-
__________________________________________________________________
334+
335+
---
323336

324337
### beforeEach()
325338

326339
Runs a code block before every test. If `beforeEach` is declared inside of a `describe` block, it runs before each test in that `describe` block.
327340

328-
Examples:
329-
Code inside `beforeEach` will execute before each tests.
341+
Examples: Code inside `beforeEach` will execute before each tests.
330342

331343
```typescript
332344
import { describe, test, beforeEach, clearStore } from "matchstick-as/assembly/index"
@@ -352,39 +364,38 @@ describe("handleNewGravatars, () => {
352364
Code inside `beforeEach` will execute only before each test in the that describe
353365

354366
```typescript
355-
import { describe, test, beforeEach } from "matchstick-as/assembly/index"
356-
import { handleUpdatedGravatar, handleNewGravatar } from "../../src/gravity"
367+
import { describe, test, beforeEach } from 'matchstick-as/assembly/index'
368+
import { handleUpdatedGravatar, handleNewGravatar } from '../../src/gravity'
357369
358-
describe("handleUpdatedGravatars", () => {
370+
describe('handleUpdatedGravatars', () => {
359371
beforeEach(() => {
360-
let gravatar = new Gravatar("0x0")
361-
gravatar.displayName = "First Gravatar"
362-
gravatar.imageUrl = ""
372+
let gravatar = new Gravatar('0x0')
373+
gravatar.displayName = 'First Gravatar'
374+
gravatar.imageUrl = ''
363375
gravatar.save()
364376
})
365377
366-
test("Upates the displayName", () => {
367-
assert.fieldEqual("Gravatar", "0x0", "displayNamd", "First Gravatar")
378+
test('Upates the displayName', () => {
379+
assert.fieldEqual('Gravatar', '0x0', 'displayNamd', 'First Gravatar')
368380
369381
// code that should update the displayName to 1st Gravatar
370382
371-
assert.fieldEqual("Gravatar", "0x0", "displayName", "1st Gravatar")
372-
store.remove("Gravatar", "0x0")
383+
assert.fieldEqual('Gravatar', '0x0', 'displayName', '1st Gravatar')
384+
store.remove('Gravatar', '0x0')
373385
})
374386
375-
test("Updates the imageUrl", () => {
376-
assert.fieldEqual("Gravatar", "0x0", "imageUrl", "")
387+
test('Updates the imageUrl', () => {
388+
assert.fieldEqual('Gravatar', '0x0', 'imageUrl', '')
377389
378390
// code that should changes the imageUrl to https://www.gravatar.com/avatar/0x0
379391
380-
assert.fieldEqual("Gravatar", "0x0", "imageUrl", "https://www.gravatar.com/avatar/0x0")
381-
store.remove("Gravatar", "0x0")
392+
assert.fieldEqual('Gravatar', '0x0', 'imageUrl', 'https://www.gravatar.com/avatar/0x0')
393+
store.remove('Gravatar', '0x0')
382394
})
383395
})
384-
385-
386396
```
387-
__________________________________________________________________
397+
398+
---
388399

389400
### afterEach()
390401

@@ -916,9 +927,9 @@ test('Derived fields example test', () => {
916927

917928
### Testing dynamic data sources
918929

919-
Testing dynamic data sources can be be done by mocking the return value of the `context()`, `address()` and `network()` functions of the dataSource namespace. These functions currently return the following: `context()` - returns an empty entity (DataSourceContext), `address()` - returns `0x0000000000000000000000000000000000000000`, `network()` - returns `mainnet`. The `create(...)` and `createWithContext(...)` functions are mocked to do nothing so they don't need to be called in the tests at all. Changes to the return values can be done through the functions of the `dataSourceMock` namespace in `matchstick-as` (version 0.3.0+).
930+
Testing dynamic data sources can be be done by mocking the return value of the `context()`, `address()` and `network()` functions of the dataSource namespace. These functions currently return the following: `context()` - returns an empty entity (DataSourceContext), `address()` - returns `0x0000000000000000000000000000000000000000`, `network()` - returns `mainnet`. The `create(...)` and `createWithContext(...)` functions are mocked to do nothing so they don't need to be called in the tests at all. Changes to the return values can be done through the functions of the `dataSourceMock` namespace in `matchstick-as` (version 0.3.0+).
920931

921-
Example below:
932+
Example below:
922933

923934
First we have the following event handler (which has been intentionally repurposed to showcase datasource mocking):
924935

pages/en/developer/publish-subgraph.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Subgraphs can be published to the decentralized network directly from the Subgra
2424

2525
### Updating metadata for a published subgraph
2626

27-
Once your subgraph has been published to the decentralized network, you can modify the metadata at any time by making the update in the Subgraph Studio dashboard of the subgraph. After saving the changes and publishing your updates to the network, they will be reflected in The Graph Explorer. This won’t create a new version, as your deployment hasn’t changed.
27+
Once your subgraph has been published to the decentralized network, you can modify the metadata at any time by making the update in the Subgraph Studio dashboard of the subgraph. After saving the changes and publishing your updates to the network, they will be reflected in The Graph Explorer. This won’t create a new version, as your deployment hasn’t changed.

0 commit comments

Comments
 (0)