Skip to content

Commit

Permalink
port of near-primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyTimes committed Jan 14, 2022
1 parent a92c1b1 commit b7beb72
Show file tree
Hide file tree
Showing 59 changed files with 1,606 additions and 681 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ exclude = [
'enclave/crates/skw-types',
'enclave/crates/skw-unit-test',
'enclave/crates/skw-utils',
'mock-enclave/src/near-vm-errors',
'mock-enclave/src/near-vm-logic',
'mock-enclave/src/near-vm-runner',
'mock-enclave/src/near-vm-runner-standalone',
'mock-enclave/src/skw-vm-primitives',
'mock-enclave/src/skw-vm-host',
'mock-enclave/src/skw-vm-engine',
'mock-enclave/src/skw-vm-engine-cli',
]
[profile.release]
panic = 'unwind'
181 changes: 0 additions & 181 deletions mock-enclave/src/near-vm-errors/Cargo.lock

This file was deleted.

24 changes: 0 additions & 24 deletions mock-enclave/src/near-vm-errors/Cargo.toml

This file was deleted.

44 changes: 0 additions & 44 deletions mock-enclave/src/near-vm-runner-standalone/Cargo.toml

This file was deleted.

40 changes: 40 additions & 0 deletions mock-enclave/src/skw-vm-engine-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "skw-vm-engine-cli"
version = "0.0.0"
authors = ["SkyeKiwi <[email protected]>", "Near Inc <[email protected]>"]
publish = false
edition = "2021"
license = "GPL-3.0"
readme = "README.md"
categories = ["wasm"]
repository = "https://github.com/skyekiwi/skyekiwi-network"
homepage = "https://github.com/skyekiwi/skyekiwi-network"
description = """
A command line wrapper around `skw-vm-engine.`
All error messages that can be raised during the contract execution are raised by `skw-vm-engine`
and the all effects of computing the execution result of a smart contract are encapsulated inside `skw-vm-engine`.
One can use `skw-vm-engine-cli` to test the smart contracts, e.g. with integration tests
to make sure it has expected behavior once deployed to the blockchain.
"""

[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
clap = "=3.0.0-beta.2"
clap_derive = "=3.0.0-beta.2"
base64 = "0.13"
strum = "0.20"
num-rational = "0.3"
tracing-span-tree = "0.1"

skw-vm-host = { path = "../skw-vm-host", features = ["costs_counting"]}
skw-vm-engine = { path = "../skw-vm-engine", features = ["wasmer2_vm"] }
skw-vm-primitives = { path = "../skw-vm-primitives" }

[dev-dependencies]
hex = "0.4"
near-test-contracts = { git = "https://github.com/near/nearcore" }

[features]
default = []
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ mod script;

use crate::script::Script;
use clap::Clap;
use near_vm_logic::VMOutcome;
use near_vm_logic::{mocks::mock_external::Receipt, ProtocolVersion};
use skw_vm_host::VMOutcome;
use skw_vm_host::{mocks::mock_external::Receipt, ProtocolVersion};
use serde::{
de::{MapAccess, Visitor},
ser::SerializeMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ use near_primitives::contract::ContractCode;
use near_primitives::runtime::config_store::RuntimeConfigStore;
use near_primitives::types::CompiledContractCache;
use near_primitives::version::PROTOCOL_VERSION;
use near_vm_logic::mocks::mock_external::MockedExternal;
use near_vm_logic::types::PromiseResult;
use near_vm_logic::{ProtocolVersion, VMConfig, VMContext, VMOutcome};

use skw_vm_host::mocks::mock_external::MockedExternal;
use skw_vm_host::types::PromiseResult;
use skw_vm_host::{ProtocolVersion, VMConfig, VMContext, VMOutcome};
// use near_vm_runner::internal::VMKind;
use near_vm_runner::{MockCompiledContractCache, VMError};
use near_vm_runner::wasmi_runner::WasmiVM;
use skw_vm_engine::{MockCompiledContractCache, VMError};
use skw_vm_engine::wasmi_runner::WasmiVM;

use crate::State;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "near-vm-runner"
name = "skw-vm-engine"
version = "0.0.0"
authors = ["SkyeKiwi <[email protected]>","Near Inc <[email protected]>"]
publish = false
edition = "2021"
license = "GPL-3.0"
readme = "README.md"
categories = ["wasm"]
repository = "https://github.com/nearprotocol/nearcore"
homepage = "https://github.com/nearprotocol/nearcore"
repository = "https://github.com/skyekiwi/skyekiwi-network"
homepage = "https://github.com/skyekiwi/skyekiwi-network"
description = """
This crate implements the specification of the interface that Near blockchain exposes to the smart contracts.
This crate implements the specification of the interface that SkyeKiwi Network secret contract runtime.
"""

[dependencies]
Expand All @@ -24,11 +24,14 @@ wasmi = "0.10.0"
lru = "0.7.2"

anyhow = { version = "1.0.19", optional = true }
near-vm-logic = { path = "../near-vm-logic", default-features = false, features = [] }
near-vm-errors = { path = "../near-vm-errors" }

skw-vm-host = { path = "../skw-vm-host", default-features = false, features = [] }
skw-vm-primitives = { path = "../skw-vm-primitives" }

lazy_static = "1.4.0"
near-primitives = { git = "https://github.com/near/nearcore", tag = "crates-0.11.0" }
near-stable-hasher = { git = "https://github.com/near/nearcore", tag = "crates-0.11.0" }

cached = "0.23.0"
tracing = { version = "0.1", default-features = false }
threadpool = "1.8.1"
Expand All @@ -40,8 +43,5 @@ wat = "1.0.40"
base64 = "0.13"

[features]
# all vms enabled for now
default = []
no_cpu_compatibility_checks = []
no_cache = []

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit b7beb72

Please sign in to comment.