Skip to content

Commit

Permalink
Minor cleanups (#3045)
Browse files Browse the repository at this point in the history
* Deduplicate wait_for_next_round.

* Remove unused WorkerError::MissingExecutedBlockInProposal.

* Make debug logs in Project::create_new consistently uppercase.

* Use consistent GraphQL indentation in READMEs.
  • Loading branch information
afck authored Dec 17, 2024
1 parent f201d21 commit adef7e0
Show file tree
Hide file tree
Showing 21 changed files with 501 additions and 526 deletions.
72 changes: 36 additions & 36 deletions examples/amm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,63 +107,63 @@ To properly setup the tokens in the proper chains, we need to do some transfer o
of the GraphiQL interface for the FUN1 app. Navigate to that URL and enter:

```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN1_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
}
```

- Transfer 50 FUN1 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_2` in `$CHAIN_2`, so they're in the proper chain:

```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN1_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
}
```

- Transfer 50 FUN2 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_1` in `$CHAIN_1`, so they're in the proper chain.
Since this is the other token, FUN2, we need to go to its own GraphiQL interface:
`echo "http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID"`.

```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
}
```

- Transfer 50 FUN2 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_2` in `$CHAIN_2`, so they're in the proper chain:

```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
}
```

All operations can only be from a remote chain i.e. other than the chain on which `AMM` is deployed to.
Expand Down
72 changes: 36 additions & 36 deletions examples/amm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,63 +111,63 @@ To properly setup the tokens in the proper chains, we need to do some transfer o
of the GraphiQL interface for the FUN1 app. Navigate to that URL and enter:
```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN1_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
}
```
- Transfer 50 FUN1 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_2` in `$CHAIN_2`, so they're in the proper chain:
```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN1_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
}
```
- Transfer 50 FUN2 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_1` in `$CHAIN_1`, so they're in the proper chain.
Since this is the other token, FUN2, we need to go to its own GraphiQL interface:
`echo "http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID"`.
```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_1",
owner: "User:$OWNER_1",
}
)
}
```
- Transfer 50 FUN2 from `$OWNER_AMM` in `$CHAIN_AMM` to `$OWNER_2` in `$CHAIN_2`, so they're in the proper chain:
```gql,uri=http://localhost:8080/chains/$CHAIN_AMM/applications/$FUN2_APP_ID
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
mutation {
transfer(
owner: "User:$OWNER_AMM",
amount: "50.",
targetAccount: {
chainId: "$CHAIN_2",
owner: "User:$OWNER_2",
}
)
}
```
All operations can only be from a remote chain i.e. other than the chain on which `AMM` is deployed to.
Expand Down
12 changes: 6 additions & 6 deletions examples/counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ Type each of these in the GraphiQL interface and substitute the env variables wi
- Navigate to the URL you get by running `echo "http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID"`.
- To get the current value of `counter`, run the query:
```gql,uri=http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID
query {
value
}
query {
value
}
```
- To increase the value of the counter by 3, perform the `increment` operation.
```gql,uri=http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID
mutation Increment {
increment(value: 3)
}
mutation Increment {
increment(value: 3)
}
```
- Running the query again would yield `4`.

Expand Down
12 changes: 6 additions & 6 deletions examples/counter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ Type each of these in the GraphiQL interface and substitute the env variables wi
- Navigate to the URL you get by running `echo "http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID"`.
- To get the current value of `counter`, run the query:
```gql,uri=http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID
query {
value
}
query {
value
}
```
- To increase the value of the counter by 3, perform the `increment` operation.
```gql,uri=http://localhost:8080/chains/$CHAIN_1/applications/$APPLICATION_ID
mutation Increment {
increment(value: 3)
}
mutation Increment {
increment(value: 3)
}
```
- Running the query again would yield `4`.
Expand Down
14 changes: 7 additions & 7 deletions examples/crowd-funding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Point your browser to http://localhost:8080, and enter the query:

```gql,uri=http://localhost:8080
query { applications(
chainId: "$CHAIN_0"
chainId: "$CHAIN_0"
) { id link } }
```

Expand All @@ -173,8 +173,8 @@ there yet. Request `crowd-funding` from the other chain. As an application ID, u

```gql,uri=http://localhost:8081
mutation { requestApplication(
chainId: "$CHAIN_1"
applicationId: "$APP_ID_1"
chainId: "$CHAIN_1"
applicationId: "$APP_ID_1"
) }
```

Expand All @@ -192,8 +192,8 @@ and run the following query:

```gql,uri=http://localhost:8080/chains/$CHAIN_0/applications/$APP_ID_1
mutation { pledge(
owner:"User:$OWNER_0",
amount:"30."
owner:"User:$OWNER_0",
amount:"30."
) }
```

Expand Down Expand Up @@ -226,7 +226,7 @@ You can check that the 200 tokens have arrived:

```gql,uri=http://localhost:8081/chains/$CHAIN_1/applications/$APP_ID_0
query {
accounts { entry(key: "User:$OWNER_1") { value } }
accounts { entry(key: "User:$OWNER_1") { value } }
}
```

Expand Down Expand Up @@ -255,7 +255,7 @@ then check that we have received 110 tokens, in addition to the

```gql,uri=http://localhost:8080/chains/$CHAIN_0/applications/$APP_ID_0
query {
accounts { entry(key: "User:$OWNER_0") { value } }
accounts { entry(key: "User:$OWNER_0") { value } }
}
```

Expand Down
14 changes: 7 additions & 7 deletions examples/crowd-funding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Point your browser to http://localhost:8080, and enter the query:
```gql,uri=http://localhost:8080
query { applications(
chainId: "$CHAIN_0"
chainId: "$CHAIN_0"
) { id link } }
```
Expand All @@ -181,8 +181,8 @@ there yet. Request `crowd-funding` from the other chain. As an application ID, u
```gql,uri=http://localhost:8081
mutation { requestApplication(
chainId: "$CHAIN_1"
applicationId: "$APP_ID_1"
chainId: "$CHAIN_1"
applicationId: "$APP_ID_1"
) }
```
Expand All @@ -200,8 +200,8 @@ and run the following query:
```gql,uri=http://localhost:8080/chains/$CHAIN_0/applications/$APP_ID_1
mutation { pledge(
owner:"User:$OWNER_0",
amount:"30."
owner:"User:$OWNER_0",
amount:"30."
) }
```
Expand Down Expand Up @@ -234,7 +234,7 @@ You can check that the 200 tokens have arrived:
```gql,uri=http://localhost:8081/chains/$CHAIN_1/applications/$APP_ID_0
query {
accounts { entry(key: "User:$OWNER_1") { value } }
accounts { entry(key: "User:$OWNER_1") { value } }
}
```
Expand Down Expand Up @@ -263,7 +263,7 @@ then check that we have received 110 tokens, in addition to the
```gql,uri=http://localhost:8080/chains/$CHAIN_0/applications/$APP_ID_0
query {
accounts { entry(key: "User:$OWNER_0") { value } }
accounts { entry(key: "User:$OWNER_0") { value } }
}
```
*/
Expand Down
Loading

0 comments on commit adef7e0

Please sign in to comment.