-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pick][GraphQL/Events] Disable filtering on both
event_type
and `em…
…itting… (#19135) …_module` (#18740) ## Description Cherry pick event indexer + graphql changes. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: wlmyng <[email protected]> Co-authored-by: Lu Zhang <[email protected]>
- Loading branch information
1 parent
5855c7f
commit 467e00c
Showing
28 changed files
with
2,093 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ jobs: | |
- name: Install Foundry Dependencies | ||
working-directory: bridge/evm | ||
run: | | ||
forge soldeer update | ||
forge install https://github.com/OpenZeppelin/[email protected] https://github.com/foundry-rs/[email protected] https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades --no-git --no-commit | ||
- name: cargo test | ||
run: | | ||
cargo nextest run --profile ci -E 'package(sui-bridge)' | ||
|
@@ -114,7 +114,7 @@ jobs: | |
- name: Install Foundry Dependencies | ||
working-directory: bridge/evm | ||
run: | | ||
forge soldeer update | ||
forge install https://github.com/OpenZeppelin/[email protected] https://github.com/foundry-rs/[email protected] https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades --no-git --no-commit | ||
- name: Check Bridge EVM Unit Tests | ||
shell: bash | ||
working-directory: bridge/evm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ out*/ | |
lcov.info | ||
broadcast/**/31337 | ||
|
||
dependencies | ||
lib/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# 🏄♂️ Quick Start | ||
|
||
This project leverages [Foundry](https://github.com/foundry-rs/foundry) to manage dependencies (via soldeer), contract compilation, testing, deployment, and on chain interactions via Solidity scripting. | ||
This project leverages [Foundry](https://github.com/foundry-rs/foundry) to manage dependencies, contract compilation, testing, deployment, and on chain interactions via Solidity scripting. | ||
|
||
#### Environment configuration | ||
|
||
|
@@ -14,7 +14,7 @@ Duplicate rename the `.env.example` file to `.env`. You'll need accounts and api | |
To install the project dependencies, run: | ||
|
||
```bash | ||
forge soldeer update | ||
forge install https://github.com/OpenZeppelin/[email protected] https://github.com/foundry-rs/[email protected] https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades --no-git --no-commit | ||
``` | ||
|
||
#### Compilation | ||
|
@@ -28,7 +28,8 @@ forge compile | |
#### Testing | ||
|
||
```bash | ||
forge test | ||
forge clean | ||
forge test --ffi | ||
``` | ||
|
||
#### Coverage | ||
|
@@ -44,13 +45,15 @@ forge coverage | |
> The file should be named `<chainID>.json` and should have the same fields and in the same order (alphabetical) as the `example.json`. | ||
```bash | ||
forge script script/deploy_bridge.s.sol --rpc-url <<alias>> --broadcast --verify | ||
forge clean | ||
forge script script/deploy_bridge.s.sol --rpc-url <<alias>> --broadcast --verify --ffi | ||
``` | ||
**Local deployment** | ||
```bash | ||
forge script script/deploy_bridge.s.sol --fork-url anvil --broadcast | ||
forge clean | ||
forge script script/deploy_bridge.s.sol --fork-url anvil --broadcast --ffi | ||
``` | ||
All deployments are saved in the `broadcast` directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
@forge-std=dependencies/forge-std-1.9.2/src | ||
@openzeppelin/foundry-upgrades=dependencies/openzeppelin-foundry-upgrades-0.3.1/src | ||
@openzeppelin/contracts=dependencies/@openzeppelin-contracts-5.0.1 | ||
@openzeppelin/contracts-upgradeable=dependencies/@openzeppelin-contracts-upgradeable-5.0.1 | ||
@forge-std-1.9.2=dependencies/forge-std-1.9.2 | ||
@openzeppelin-foundry-upgrades-0.3.1=dependencies/openzeppelin-foundry-upgrades-0.3.1 | ||
@openzeppelin-contracts-upgradeable-5.0.1=dependencies/@openzeppelin-contracts-upgradeable-5.0.1 | ||
@openzeppelin-contracts-5.0.1=dependencies/@openzeppelin-contracts-5.0.1 | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/ | ||
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ | ||
@openzeppelin/openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
forge-std/=lib/openzeppelin-foundry-upgrades/lib/forge-std/src/ |
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
processed 5 tasks | ||
|
||
init: | ||
A: object(0,0), B: object(0,1) | ||
|
||
task 1, lines 9-28: | ||
//# publish | ||
created: object(1,0) | ||
mutated: object(0,2) | ||
gas summary: computation_cost: 1000000, storage_cost: 5380800, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 2, line 30: | ||
//# run Test::M2::emit_emit_a --sender A --args 20 | ||
events: Event { package_id: Test, transaction_module: Identifier("M2"), sender: A, type_: StructTag { address: Test, module: Identifier("M1"), name: Identifier("EventA"), type_params: [] }, contents: [20, 0, 0, 0, 0, 0, 0, 0] } | ||
mutated: object(0,0) | ||
gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 0, non_refundable_storage_fee: 0 | ||
|
||
task 3, line 32: | ||
//# create-checkpoint | ||
Checkpoint created: 1 | ||
|
||
task 4, lines 34-51: | ||
//# run-graphql | ||
Response: { | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Filtering by both emitting module and event type is not supported", | ||
"locations": [ | ||
{ | ||
"line": 2, | ||
"column": 3 | ||
} | ||
], | ||
"path": [ | ||
"events" | ||
], | ||
"extensions": { | ||
"code": "BAD_USER_INPUT" | ||
} | ||
} | ||
] | ||
} |
51 changes: 51 additions & 0 deletions
51
crates/sui-graphql-e2e-tests/tests/event_connection/combo_filter_error.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Tests that fetching events filtered on both emitting module and event would result | ||
// in an error. | ||
|
||
//# init --protocol-version 51 --addresses Test=0x0 --accounts A B --simulator | ||
|
||
//# publish | ||
module Test::M1 { | ||
use sui::event; | ||
|
||
public struct EventA has copy, drop { | ||
new_value: u64 | ||
} | ||
|
||
public fun emit_a(value: u64) { | ||
event::emit(EventA { new_value: value }) | ||
} | ||
} | ||
|
||
module Test::M2 { | ||
use Test::M1; | ||
|
||
public fun emit_emit_a(value: u64) { | ||
M1::emit_a(value); | ||
} | ||
} | ||
|
||
//# run Test::M2::emit_emit_a --sender A --args 20 | ||
|
||
//# create-checkpoint | ||
|
||
//# run-graphql | ||
{ | ||
events(filter: {sender: "@{A}", emittingModule: "@{Test}::M2", eventType: "@{Test}::M1::EventA"}) { | ||
nodes { | ||
sendingModule { | ||
name | ||
} | ||
type { | ||
repr | ||
} | ||
sender { | ||
address | ||
} | ||
json | ||
bcs | ||
} | ||
} | ||
} |
Oops, something went wrong.