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

Move odra cli to the main repo #515

Merged
merged 9 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"odra-casper/livenet-env",
"odra-casper/wasm-env",
"odra-casper/test-vm",
"odra-cli",
"odra-schema",
"odra-test",
"odra-build"
Expand All @@ -29,6 +30,7 @@ odra-casper-test-vm = { path = "odra-casper/test-vm", version = "1.3.0" }
odra-casper-rpc-client = { path = "odra-casper/rpc-client", version = "1.3.0" }
odra-vm = { path = "odra-vm", version = "1.3.0" }
odra-casper-wasm-env = { path = "odra-casper/wasm-env", version = "1.3.0"}
odra-casper-livenet-env = { path = "odra-casper/livenet-env", version = "1.3.0"}
odra-schema = { path = "odra-schema", version = "1.3.0" }
casper-contract = { version = "4.0.0", default-features = false }
casper-types = { version = "4.0.1", default-features = false }
Expand Down
9 changes: 6 additions & 3 deletions core/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ impl HostEnv {
let backend = self.backend.borrow();
backend.register_contract(address, contract_name, entry_points_caller);
self.deployed_contracts.borrow_mut().push(address);
self.events_count
.borrow_mut()
.insert(address, backend.get_events_count(&address));
}

/// Calls a contract at the specified address with the given call definition.
Expand Down Expand Up @@ -338,6 +335,12 @@ impl HostEnv {
.borrow()
.iter()
.for_each(|contract_address| {
if binding.get(contract_address).is_none() {
binding.insert(
*contract_address,
backend.get_events_count(contract_address)
);
}
let events_count = binding.get_mut(contract_address).unwrap();
let old_events_last_id = *events_count;
let new_events_count = backend.get_events_count(contract_address);
Expand Down
20 changes: 20 additions & 0 deletions odra-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "odra-cli"
version = "0.1.0"
edition = "2021"

[dependencies]
clap = { version = "4.5.4", features = ["derive", "cargo", "string"] }
prettycli = "0.1.1"
odra = { path = "../odra", default-features = false }
odra-casper-livenet-env = { workspace = true }
chrono = { version = "0.4", features = ["serde"] }
serde = { version = "1", default-features = false }
serde_json = { version = "1", default-features = false }
serde_derive = { version = "1", features = ["default"] }
toml = "0.8.13"
project-root = "0.2.2"
pretty_assertions = "1.4.0"
anyhow = "1.0.86"
thiserror = "1.0.30"
hex = "0.4.3"
Loading
Loading