-
Notifications
You must be signed in to change notification settings - Fork 80
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
Signing e2e tests #981
base: musitdev/alloy-integration
Are you sure you want to change the base?
Signing e2e tests #981
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3" | ||
|
||
environment: | ||
|
||
processes: | ||
bridge_e2e-tests: | ||
command: | | ||
cargo test -p movement-signer-e2e-test e2e_eth_signing -- --nocapture --test-threads=1 | ||
depends_on: | ||
signing_local_setup: | ||
condition: process_healthy | ||
availability: | ||
exit_on_end: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: "3" | ||
|
||
processes: | ||
|
||
setup: | ||
environment: | ||
- "ETH_RPC_CONNECTION_PROTOCOL=http" | ||
- "ETH_RPC_CONNECTION_HOSTNAME=0.0.0.0" | ||
- "ETH_RPC_CONNECTION_PORT=8090" | ||
- "ETH_WS_CONNECTION_PROTOCOL=ws" | ||
- "ETH_WS_CONNECTION_HOSTNAME=0.0.0.0" | ||
- "ETH_WS_CONNECTION_PORT=8090" | ||
- "MAYBE_RUN_LOCAL=true" | ||
- "MAYBE_TESTING_MCR=true" | ||
- "MAYBE_DEPLOY_MCR=true" | ||
|
||
command: | | ||
movement-full-node-setup | ||
depends_on: | ||
build: | ||
condition: process_completed_successfully | ||
readiness_probe: | ||
initial_delay_seconds: 10 | ||
exec: | ||
command: echo "true" | ||
|
||
signing_local_setup: | ||
command: | | ||
cargo run -p movement-signer-e2e-test --bin setup_awskms_eth_key | ||
availability: | ||
restart: exit_on_failure | ||
depends_on: | ||
movement-faucet: | ||
condition: process_healthy | ||
readiness_probe: | ||
initial_delay_seconds: 20 | ||
exec: | ||
command: echo "true" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: "3" | ||
|
||
processes: | ||
|
||
setup: | ||
environment: | ||
- "ETH_RPC_CONNECTION_PROTOCOL=http" | ||
- "ETH_RPC_CONNECTION_HOSTNAME=0.0.0.0" | ||
- "ETH_RPC_CONNECTION_PORT=8090" | ||
- "ETH_WS_CONNECTION_PROTOCOL=ws" | ||
- "ETH_WS_CONNECTION_HOSTNAME=0.0.0.0" | ||
- "ETH_WS_CONNECTION_PORT=8090" | ||
- "MAYBE_RUN_LOCAL=true" | ||
- "MAYBE_TESTING_MCR=true" | ||
- "MAYBE_DEPLOY_MCR=true" | ||
|
||
command: | | ||
movement-full-node-setup | ||
depends_on: | ||
build: | ||
condition: process_completed_successfully | ||
readiness_probe: | ||
initial_delay_seconds: 10 | ||
exec: | ||
command: echo "true" | ||
|
||
signing_local_setup: | ||
command: | | ||
cargo run -p movement-signer-e2e-test --bin setup_local_eth_key | ||
availability: | ||
restart: exit_on_failure | ||
depends_on: | ||
movement-faucet: | ||
condition: process_healthy | ||
readiness_probe: | ||
initial_delay_seconds: 20 | ||
exec: | ||
command: echo "true" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
version: "3" | ||
|
||
processes: | ||
|
||
build: | ||
command: | | ||
exit 0 | ||
|
||
setup: | ||
command: | | ||
# sleep forever | ||
sleep 999999999d | ||
depends_on: | ||
build: | ||
condition: process_completed_successfully | ||
|
||
celestia-light-node: | ||
command: | | ||
exit 1 | ||
depends_on: | ||
setup: | ||
condition: process_healthy | ||
|
||
celestia-light-node-synced: | ||
command: | | ||
wait-for-celestia-light-node | ||
depends_on: | ||
celestia-light-node: | ||
condition: process_healthy | ||
|
||
movement-celestia-da-light-node: | ||
command: | | ||
movement-celestia-da-light-node | ||
depends_on: | ||
celestia-light-node: | ||
condition: process_healthy | ||
celestia-light-node-synced: | ||
condition: process_completed_successfully | ||
readiness_probe: | ||
initial_delay_seconds: 3 | ||
exec: | ||
command: grpcurl -plaintext 0.0.0.0:30730 list | ||
|
||
movement-full-node: | ||
command: | | ||
movement-full-node | ||
depends_on: | ||
movement-celestia-da-light-node: | ||
condition: process_healthy | ||
readiness_probe: | ||
initial_delay_seconds: 10 | ||
exec: | ||
command: curl http://0.0.0.0:30731 | ||
|
||
movement-faucet: | ||
command : | | ||
movement-faucet-service run-simple | ||
depends_on: | ||
movement-full-node: | ||
condition: process_healthy | ||
readiness_probe: | ||
initial_delay_seconds: 30 | ||
exec: | ||
command: curl http://0.0.0.0:30732 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "movement-signer-config" | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
authors.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
publish.workspace = true | ||
rust-version.workspace = true | ||
|
||
[dependencies] | ||
serde = { workspace = true , features = ["derive"] } | ||
|
||
[lints] | ||
workspace = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! This crate provides configuration parameters for signing KeyManager | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub enum KeyProvider { | ||
#[default] | ||
LOCALETH, | ||
LOCALMVT, | ||
AWSKMS, | ||
VAULT, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct KeyDefinition { | ||
#[serde(default)] | ||
pub name: String, | ||
#[serde(default)] | ||
pub provider: KeyProvider, | ||
#[serde(default)] | ||
pub id: String, | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct Config { | ||
#[serde(default)] | ||
pub key_list: Vec<KeyDefinition>, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "movement-signer-e2e-test" | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
authors.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
publish.workspace = true | ||
rust-version.workspace = true | ||
|
||
[[bin]] | ||
name = "setup_local_eth_key" | ||
path = "bin/setup_local_eth_key.rs" | ||
|
||
[[bin]] | ||
name = "setup_awskms_eth_key" | ||
path = "bin/setup_awskms_eth_key.rs" | ||
|
||
|
||
[dependencies] | ||
movement-signer-setup = { workspace = true } | ||
movement-signer-config = { workspace = true } | ||
godfig = { workspace = true } | ||
|
||
anyhow = { workspace = true } | ||
tokio = { workspace = true } | ||
|
||
|
||
[dev-dependencies] | ||
|
||
|
||
[lints] | ||
workspace = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Create the config that contains one Eth key that sign using AWS KMS. | ||
use godfig::env_default; | ||
use movement_signer_config::KeyDefinition; | ||
use movement_signer_config::KeyProvider; | ||
|
||
fn main() { | ||
env_default!(get_aws_key_id, "AWS_KEY_ID", String); | ||
let awskms_key_id = get_aws_key_id().expect("AWS_KEY_ID not defined in env."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't really show me a lot to do with how you integrate this with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
let key = KeyDefinition { | ||
name: "ETH_TEST_KEY1".to_string(), | ||
provider: KeyProvider::LOCALETH, | ||
id: awskms_key_id, | ||
}; | ||
movement_signer_setup::setup_sign_config(vec![key]).unwrap(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Create the config that contains one Eth key that sign in local. | ||
use movement_signer_config::KeyDefinition; | ||
use movement_signer_config::KeyProvider; | ||
|
||
fn main() { | ||
let key = KeyDefinition { | ||
name: "ETH_TEST_KEY1".to_string(), | ||
provider: KeyProvider::AWSKMS, | ||
id: String::new(), | ||
}; | ||
movement_signer_setup::setup_sign_config(vec![key]).unwrap(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn main() {} | ||
|
||
// Run the e2e signing Test. | ||
// e2e signing test are run using real node: 'ex Anvil and Suzuka node). | ||
// Depending on the executed setup it doesn't use the same key/provided.. | ||
#[tokio::test] | ||
async fn e2e_eth_signing() -> Result<(), anyhow::Error> { | ||
//use the ETH_TEST_KEY1 name to get the key from the Key Manager. | ||
todo!() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum variants should not be all caps: https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I thought it was UpperCamelCase when the variant contains fields and all upper case when it's a constant. I'll update.