Skip to content

Commit

Permalink
feat(e2e-tests): support protocol test matrix, implement icp protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
fbozic committed Jan 10, 2025
1 parent 8d6bfa0 commit d783e4d
Show file tree
Hide file tree
Showing 14 changed files with 417 additions and 103 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rand.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
tokio = { workspace = true, features = ["fs", "io-util", "macros", "process", "rt", "rt-multi-thread", "time"] }
url = { workspace = true }

[lints]
workspace = true
23 changes: 19 additions & 4 deletions e2e-tests/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,23 @@
"merod": {
"args": []
},
"near": {
"contextConfigContract": "./contracts/near/context-config/res/calimero_context_config_near.wasm",
"proxyLibContract": "./contracts/near/context-proxy/res/calimero_context_proxy_near.wasm"
}
"protocolSandboxes": [
{
"protocol": "near",
"config": {
"contextConfigContract": "./contracts/near/context-config/res/calimero_context_config_near.wasm",
"proxyLibContract": "./contracts/near/context-proxy/res/calimero_context_proxy_near.wasm"
}
},
{
"protocol": "icp",
"config": {
"contextConfigContractId": "bkyz2-fmaaa-aaaaa-qaaaq-cai",
"rpcUrl": "http://127.0.0.1:4943",
"accountId": "fph2z-lxdui-xq3o6-6kuqy-rgkwi-hq7us-gkwlq-gxfgs-irrcq-hnm4e-6qe",
"publicKey": "e3a22f0dbbde552188995641e1fa48cab2e06b94d24462281dace13d02",
"secretKey": "c9a8e56920efd1c7b6694dce6ce871b661ae3922d5045d4a9f04e131eaa34164"
}
}
]
}
21 changes: 19 additions & 2 deletions e2e-tests/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
pub struct Config {
pub network: Network,
pub merod: MerodConfig,
pub near: Near,
pub protocol_sandboxes: Box<[ProtocolSandboxConfig]>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
Expand All @@ -24,9 +24,26 @@ pub struct MerodConfig {
pub args: Box<[String]>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "protocol", content = "config", rename_all = "camelCase")]
pub enum ProtocolSandboxConfig {
Near(NearProtocolConfig),
Icp(IcpProtocolConfig),
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Near {
pub struct NearProtocolConfig {
pub context_config_contract: Utf8PathBuf,
pub proxy_lib_contract: Utf8PathBuf,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct IcpProtocolConfig {
pub context_config_contract_id: String,
pub rpc_url: String,
pub account_id: String,
pub public_key: String,
pub secret_key: String,
}
Loading

0 comments on commit d783e4d

Please sign in to comment.