Skip to content

Commit

Permalink
Improve ‘publishability’ of crates
Browse files Browse the repository at this point in the history
To be able to publish a crate all its dependencies must be versioned.
Make sure that this is the case for all packages listed in the
`runtime/publish.sh` script.

Note that this does not fix the issue completely and there are still
other problems stopping the crates from being published.  Most
notably, some of the dependencies not being published yet.

Issue: near#4379
  • Loading branch information
mina86 committed Jun 21, 2021
1 parent 87776be commit e9f70cd
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 28 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

7 changes: 3 additions & 4 deletions runtime/near-vm-logic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ serde = { version = "1", features = ["derive"] }
sha2 = ">=0.8,<0.10"
sha3 = ">=0.8,<0.10"

near-primitives = { path = "../../core/primitives" }
near-primitives-core = { path = "../../core/primitives-core", version = "0.1.0" }
near-primitives = { path = "../../core/primitives", version = "0.1.0" }
near-vm-errors = { path = "../near-vm-errors", version = "3.0.0" }
near-runtime-utils = { path = "../near-runtime-utils", version = "3.0.0" }

Expand All @@ -33,8 +32,8 @@ serde_json = {version= "1", features= ["preserve_order"]}

[features]
default = []
protocol_feature_evm = ["near-primitives-core/protocol_feature_evm"]
protocol_feature_alt_bn128 = ["bn", "near-primitives-core/protocol_feature_alt_bn128", "near-vm-errors/protocol_feature_alt_bn128"]
protocol_feature_evm = ["near-primitives/protocol_feature_evm"]
protocol_feature_alt_bn128 = ["bn", "near-primitives/protocol_feature_alt_bn128", "near-vm-errors/protocol_feature_alt_bn128"]
protocol_feature_allow_create_account_on_delete = []

# Use this feature to enable counting of fees and costs applied.
Expand Down
4 changes: 2 additions & 2 deletions runtime/near-vm-logic/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::types::PublicKey;
use near_primitives_core::serialize::u64_dec_format;
use near_primitives_core::types::{
use near_primitives::serialize::u64_dec_format;
use near_primitives::types::{
AccountId, Balance, BlockHeight, EpochHeight, Gas, StorageUsage,
};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/src/dependencies.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! External dependencies of the near-vm-logic.
use crate::types::{PublicKey, ReceiptIndex};
use near_primitives_core::types::{AccountId, Balance, Gas};
use near_primitives::types::{AccountId, Balance, Gas};
use near_vm_errors::VMLogicError;

/// An abstraction over the memory of the smart contract.
Expand Down
8 changes: 4 additions & 4 deletions runtime/near-vm-logic/src/gas_counter.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{HostError, VMLogicError};
#[cfg(feature = "protocol_feature_evm")]
use near_primitives_core::runtime::fees::EvmGas;
use near_primitives_core::runtime::fees::Fee;
use near_primitives_core::{
use near_primitives::runtime::fees::EvmGas;
use near_primitives::runtime::fees::Fee;
use near_primitives::{
config::{ActionCosts, ExtCosts, ExtCostsConfig},
profile::ProfileData,
types::Gas,
Expand Down Expand Up @@ -235,7 +235,7 @@ impl GasCounter {
#[cfg(test)]
mod tests {
use super::*;
use near_primitives_core::config::ExtCostsConfig;
use near_primitives::config::ExtCostsConfig;

#[test]
fn test_deduct_gas() {
Expand Down
6 changes: 3 additions & 3 deletions runtime/near-vm-logic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ mod utils;
pub use context::VMContext;
pub use dependencies::{External, MemoryLike, ValuePtr};
pub use logic::{VMLogic, VMOutcome};
pub use near_primitives_core::config::*;
pub use near_primitives_core::profile;
pub use near_primitives_core::types::ProtocolVersion;
pub use near_primitives::config::*;
pub use near_primitives::profile;
pub use near_primitives::types::ProtocolVersion;
pub use near_vm_errors::{HostError, VMLogicError};
pub use types::ReturnData;

Expand Down
10 changes: 5 additions & 5 deletions runtime/near-vm-logic/src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use crate::ValuePtr;
use byteorder::ByteOrder;
use near_primitives::checked_feature;
use near_primitives::version::is_implicit_account_creation_enabled;
use near_primitives_core::config::ExtCosts::*;
use near_primitives_core::config::{ActionCosts, ExtCosts, VMConfig};
use near_primitives_core::profile::ProfileData;
use near_primitives_core::runtime::fees::{
use near_primitives::config::ExtCosts::*;
use near_primitives::config::{ActionCosts, ExtCosts, VMConfig};
use near_primitives::profile::ProfileData;
use near_primitives::runtime::fees::{
transfer_exec_fee, transfer_send_fee, RuntimeFeesConfig,
};
use near_primitives_core::types::{
use near_primitives::types::{
AccountId, Balance, EpochHeight, Gas, ProtocolVersion, StorageUsage,
};
use near_runtime_utils::is_account_id_64_len_hex;
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/src/mocks/mock_external.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{External, ValuePtr};
use near_primitives_core::types::{AccountId, Balance, Gas};
use near_primitives::types::{AccountId, Balance, Gas};
use near_vm_errors::HostError;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};

pub use near_primitives_core::types::*;
pub use near_primitives::types::*;

pub type PublicKey = Vec<u8>;
pub type PromiseIndex = u64;
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/tests/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use near_primitives_core::{config::ExtCosts, types::Gas};
use near_primitives::{config::ExtCosts, types::Gas};
use near_vm_errors::VMLogicError;
use near_vm_logic::{gas_counter::with_ext_cost_counter, VMLogic};
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-logic/tests/vm_logic_builder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use near_primitives_core::runtime::fees::RuntimeFeesConfig;
use near_primitives::runtime::fees::RuntimeFeesConfig;
use near_vm_logic::mocks::mock_external::MockedExternal;
use near_vm_logic::mocks::mock_memory::MockedMemory;
use near_vm_logic::VMContext;
Expand Down
1 change: 0 additions & 1 deletion runtime/near-vm-runner-standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ tracing-subscriber = "0.2"

near-vm-logic = { path = "../near-vm-logic", version = "3.0.0", features = ["costs_counting"]}
near-vm-runner = { path = "../near-vm-runner", version = "3.0.0", features = ["wasmtime_vm", "wasmer1_vm"] }
near-primitives-core = { path = "../../core/primitives-core", version = "0.1.0" }
near-primitives = { path = "../../core/primitives", version = "0.1.0" }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions runtime/near-vm-runner-standalone/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::path::Path;

use near_primitives::contract::ContractCode;
use near_primitives::types::CompiledContractCache;
use near_primitives_core::profile::ProfileData;
use near_primitives_core::runtime::fees::RuntimeFeesConfig;
use near_primitives::profile::ProfileData;
use near_primitives::runtime::fees::RuntimeFeesConfig;
use near_vm_logic::mocks::mock_external::MockedExternal;
use near_vm_logic::types::PromiseResult;
use near_vm_logic::{ProtocolVersion, VMConfig, VMContext, VMOutcome};
Expand Down

0 comments on commit e9f70cd

Please sign in to comment.