Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 226 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ near-abi = "0.4.4"
near-account-id = "2.5.0"
near-jsonrpc-client = "0.20.0"
near-jsonrpc-primitives = "0.34.6"
near-kit = { version = "0.7.0", default-features = false }
near-primitives = "0.34.6"
near-sandbox = "0.3.5"
near-sdk = { version = "5.24.1", features = [
"legacy",
"unit-testing",
Expand Down
11 changes: 7 additions & 4 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [
"cargo-deny-no-advisories",
"zizmor",
"check-markdown-links",
"sandbox-image-version",
"check",
"check-docs",
"clippy",
Expand All @@ -21,10 +22,7 @@ dependencies = [

[tasks.check-all]
description = "Run all checks"
dependencies = [
"check-all-fast",
"nextest",
]
dependencies = ["check-all-fast", "nextest"]

[tasks.check-extra]
description = "Run extra checks"
Expand Down Expand Up @@ -129,5 +127,10 @@ RUSTDOCFLAGS = "-D warnings"
command = "lychee"
args = ["--no-progress", "."]

[tasks.sandbox-image-version]
description = "Check that sandbox Docker image version matches nearcore"
command = "bash"
args = ["scripts/check-sandbox-image-version.sh"]

[config]
default_to_workspace = false
9 changes: 7 additions & 2 deletions crates/e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ license = { workspace = true }
anyhow = { workspace = true }
bs58 = { workspace = true }
ed25519-dalek = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
near-kit = { workspace = true }
near-mpc-contract-interface = { workspace = true }
near-mpc-crypto-types = { workspace = true }
near-sandbox = { workspace = true }
near-workspaces = { workspace = true, features = ["unstable"] }
rand = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
tracing = { workspace = true }

Expand Down
82 changes: 82 additions & 0 deletions crates/e2e-tests/src/blockchain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
use ed25519_dalek::SigningKey;
use near_mpc_contract_interface::types::ProtocolContractState;
use serde::de::DeserializeOwned;

pub struct NearBlockchain {
_rpc_url: String,
}

pub struct ClientHandle {
_private: (),
}

impl NearBlockchain {
pub fn new(
_rpc_url: &str,
_root_account: &str,
_root_secret_key: &str,
) -> anyhow::Result<Self> {
unimplemented!("NEAR RPC client implementation — see Change 2")
}

pub async fn create_account(
&self,
_name: &str,
_balance_near: u64,
_key: &SigningKey,
) -> anyhow::Result<()> {
unimplemented!()
}

pub async fn create_account_and_deploy(
&self,
_name: &str,
_balance_near: u64,
_key: &SigningKey,
_wasm: &[u8],
) -> anyhow::Result<DeployedContract> {
unimplemented!()
}

pub fn client_for(&self, _account_id: &str, _key: &SigningKey) -> anyhow::Result<ClientHandle> {
unimplemented!()
}

pub fn rpc_url(&self) -> &str {
unimplemented!()
}
}

pub struct DeployedContract {
contract_id: String,
}

impl DeployedContract {
pub fn contract_id(&self) -> &str {
&self.contract_id
}

pub async fn call(&self, _method: &str, _args: serde_json::Value) -> anyhow::Result<()> {
unimplemented!()
}

pub async fn call_from(
&self,
_client: &ClientHandle,
_method: &str,
_args: serde_json::Value,
) -> anyhow::Result<()> {
unimplemented!()
}

pub async fn view<T: DeserializeOwned + Send + 'static>(
&self,
_method: &str,
) -> anyhow::Result<T> {
unimplemented!()
}

pub async fn state(&self) -> anyhow::Result<ProtocolContractState> {
self.view("state").await
}
}
Loading
Loading