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

refactor(tests): Spawn node for the tests #195

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

gshep
Copy link
Member

@gshep gshep commented Nov 4, 2024

Resolves #161

@gear-tech/dev

@mertwole mertwole marked this pull request as draft November 5, 2024 05:34
@gshep gshep requested a review from mertwole November 7, 2024 11:03
@gshep gshep marked this pull request as ready for review November 7, 2024 11:03
@gshep gshep changed the title Draft: refactor(tests): Spawn node for the tests refactor(tests): Spawn node for the tests Nov 7, 2024
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
gear-programs/erc20-relay/app/tests/gclient.rs Outdated Show resolved Hide resolved
gear-programs/erc20-relay/app/tests/gclient.rs Outdated Show resolved Hide resolved
relayer/src/ethereum_checkpoints/tests/mod.rs Outdated Show resolved Hide resolved
relayer/src/ethereum_checkpoints/tests/mod.rs Outdated Show resolved Hide resolved
relayer/src/ethereum_checkpoints/tests/mod.rs Outdated Show resolved Hide resolved
relayer/src/ethereum_checkpoints/tests/mod.rs Outdated Show resolved Hide resolved
relayer/src/ethereum_checkpoints/tests/mod.rs Outdated Show resolved Hide resolved
@gshep gshep requested a review from mertwole November 26, 2024 18:26
Conflicts:
	.github/workflows/ci.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move these .json and .zst files to a new folder like tests/data ?

}

#[ignore]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

async fn spin_up_node() -> (GClientRemoting, GearApi, CodeId, GasUnit) {
static LOCK: Mutex<(u32, Option<CodeId>)> = Mutex::const_new((0, None));

async fn spin_up_node() -> (impl Remoting + Clone, GearApi, CodeId, GasUnit, [u8; 4]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async fn spin_up_node() -> (impl Remoting + Clone, GearApi, CodeId, GasUnit, [u8; 4]) {
async fn connect_to_node() -> (impl Remoting + Clone, GearApi, CodeId, GasUnit, [u8; 4]) {

api,
code_id,
gas_limit,
salt.to_le_bytes(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just generate random [u8; 32] for salt? As I see it will simplify code a lot


let bootstrap = beacon_client.get_bootstrap(&checkpoint_hex).await?;
println!("bootstrap slot = {}", bootstrap.header.slot);
async fn live_init_holesky() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to go without these tests as they're anyway intended to use only for manual testing. If you need them I think they can be moved to /tools (and don't expose endpoints, just read env vars)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor erc20-relay tests to spawn node
2 participants