Skip to content

Commit

Permalink
Merge 526ebb0 into 19fe191
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Nov 28, 2019
2 parents 19fe191 + 526ebb0 commit 609210f
Show file tree
Hide file tree
Showing 37 changed files with 111 additions and 208 deletions.
4 changes: 3 additions & 1 deletion abi/Cargo.toml
Expand Up @@ -17,7 +17,8 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
[dependencies]
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
derive_more = { version = "0.99.2", default-features = false, features = ["from"] }
ink_abi_derive = { version = "0.1.0", path = "derive", default-features = false, optional = true }
ink_abi_derive = { path = "derive", default-features = false, optional = true }
ink_prelude = { path = "../prelude/", default-features = false }
type-metadata = { git = "https://github.com/type-metadata/type-metadata.git", default-features = false, features = ["derive"] }

[dev-dependencies]
Expand All @@ -30,6 +31,7 @@ default = [
]
std = [
"ink_abi_derive/std",
"ink_prelude/std",
"serde/std",
"type-metadata/std",
]
Expand Down
4 changes: 3 additions & 1 deletion core/Cargo.toml
Expand Up @@ -18,7 +18,8 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
ink_abi = { path = "../abi/", default-features = false, features = ["derive"], optional = true }
ink_alloc = { path = "../alloc/", default-features = false }
ink_utils = { path = "../utils/" }
ink_core_derive = { version = "0.1.0", path = "derive", default-features = false }
ink_core_derive = { path = "derive", default-features = false }
ink_prelude = { path = "../prelude/", default-features = false }

scale = { package = "parity-scale-codec", version = "1.1", default-features = false, features = ["derive", "full"] }
type-metadata = { git = "https://github.com/type-metadata/type-metadata.git", default-features = false, features = ["derive"], optional = true }
Expand All @@ -34,6 +35,7 @@ test-env = [
std = [
"ink_abi/std",
"ink_alloc/std",
"ink_prelude/std",
"scale/std",
"type-metadata/std",
]
Expand Down
2 changes: 1 addition & 1 deletion core/src/env/api.rs
Expand Up @@ -28,9 +28,9 @@ use crate::{
CreateError,
EnvStorage as _,
},
memory::vec::Vec,
storage::Key,
};
use ink_prelude::vec::Vec;

/// Stores the given value under the specified key in the contract storage.
///
Expand Down
22 changes: 10 additions & 12 deletions core/src/env/calls.rs
Expand Up @@ -16,18 +16,16 @@ use core::marker::PhantomData;

use scale::Decode;

use crate::{
env::{
self,
CallError,
CreateError,
Env,
EnvTypes,
},
memory::{
vec,
vec::Vec,
},
use crate::env::{
self,
CallError,
CreateError,
Env,
EnvTypes,
};
use ink_prelude::{
vec,
vec::Vec,
};

/// Consists of the input data to a call.
Expand Down
2 changes: 1 addition & 1 deletion core/src/env/srml/srml_only/impls.rs
Expand Up @@ -28,9 +28,9 @@ use crate::{
EnvStorage,
EnvTypes,
},
memory::vec::Vec,
storage::Key,
};
use ink_prelude::vec::Vec;

/// Load the contents of the scratch buffer
fn read_scratch_buffer() -> Vec<u8> {
Expand Down
8 changes: 4 additions & 4 deletions core/src/env/test_env.rs
Expand Up @@ -29,12 +29,12 @@ use crate::{
CallError,
EnvTypes,
},
memory::collections::hash_map::{
Entry,
HashMap,
},
storage::Key,
};
use ink_prelude::collections::hash_map::{
Entry,
HashMap,
};

/// A wrapper for the generic bytearray used for data in contract events.
#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down
6 changes: 2 additions & 4 deletions core/src/env/traits.rs
Expand Up @@ -17,10 +17,8 @@ use scale::{
Decode,
};

use crate::{
memory::vec::Vec,
storage::Key,
};
use crate::storage::Key;
use ink_prelude::vec::Vec;

/// Error encountered by calling a remote contract.
///
Expand Down
22 changes: 10 additions & 12 deletions core/src/env2/call/builder.rs
Expand Up @@ -14,20 +14,18 @@

use core::marker::PhantomData;

use crate::{
env2::{
call::{
state,
CallData,
Selector,
},
errors::CallError,
Env,
EnvAccessMut,
EnvTypes,
use crate::env2::{
call::{
state,
CallData,
Selector,
},
memory::vec::Vec,
errors::CallError,
Env,
EnvAccessMut,
EnvTypes,
};
use ink_prelude::vec::Vec;

/// Represents a return type.
///
Expand Down
20 changes: 9 additions & 11 deletions core/src/env2/call/create.rs
Expand Up @@ -14,19 +14,17 @@

use core::marker::PhantomData;

use crate::{
env2::{
call::{
CallData,
Selector,
},
errors::CreateError,
Env,
EnvAccessMut,
EnvTypes,
use crate::env2::{
call::{
CallData,
Selector,
},
memory::vec::Vec,
errors::CreateError,
Env,
EnvAccessMut,
EnvTypes,
};
use ink_prelude::vec::Vec;

pub mod state {
pub use crate::env2::call::state::{
Expand Down
3 changes: 1 addition & 2 deletions core/src/env2/call/utils.rs
Expand Up @@ -13,8 +13,7 @@
// limitations under the License.

use derive_more::From;

use crate::memory::{
use ink_prelude::{
vec,
vec::Vec,
};
Expand Down
2 changes: 1 addition & 1 deletion core/src/env2/env_access/mutable.rs
Expand Up @@ -30,7 +30,6 @@ use crate::{
SetProperty,
Topics,
},
memory::vec::Vec,
storage::{
alloc::{
Allocate,
Expand All @@ -41,6 +40,7 @@ use crate::{
Key,
},
};
use ink_prelude::vec::Vec;

#[cfg_attr(feature = "ink-generate-abi", derive(type_metadata::Metadata))]
#[derive(Debug)]
Expand Down
12 changes: 5 additions & 7 deletions core/src/env2/test/account.rs
Expand Up @@ -23,14 +23,12 @@

use core::borrow::Borrow;

use crate::{
env2::test::{
storage::Storage,
types::*,
TypedEncoded,
},
memory::collections::btree_map::BTreeMap,
use crate::env2::test::{
storage::Storage,
types::*,
TypedEncoded,
};
use ink_prelude::collections::btree_map::BTreeMap;

/// The on-chain registered accounts.
///
Expand Down
2 changes: 1 addition & 1 deletion core/src/env2/test/record.rs
Expand Up @@ -39,9 +39,9 @@ use crate::{
EnvTypes,
Topics,
},
memory::vec::Vec,
storage::Key,
};
use ink_prelude::vec::Vec;

/// A record of an event happening on the off-chain test environment.
///
Expand Down
10 changes: 4 additions & 6 deletions core/src/env2/test/storage.rs
Expand Up @@ -20,12 +20,10 @@

use core::cell::Cell;

use crate::{
memory::collections::btree_map::{
self,
BTreeMap,
},
storage::Key,
use crate::storage::Key;
use ink_prelude::collections::btree_map::{
self,
BTreeMap,
};

/// An entry in the storage of the test environment.
Expand Down
2 changes: 1 addition & 1 deletion core/src/env2/types.rs
Expand Up @@ -35,9 +35,9 @@ use type_metadata::Metadata;

use crate::{
env2::EnvTypes,
memory::vec::Vec,
storage::Flush,
};
use ink_prelude::vec::Vec;

/// The fundamental types of the SRML default configuration.
#[cfg_attr(feature = "test-env", derive(Debug, Clone, PartialEq, Eq))]
Expand Down
3 changes: 1 addition & 2 deletions core/src/env2/utils.rs
Expand Up @@ -14,13 +14,12 @@

//! Utility definitions used for environmental access.

use ink_prelude::vec::Vec;
use smallvec::{
Array,
SmallVec,
};

use crate::memory::vec::Vec;

/// Buffers that allow to reset themselves.
///
/// # Note
Expand Down
4 changes: 0 additions & 4 deletions core/src/lib.rs
Expand Up @@ -47,16 +47,12 @@
#[cfg(not(feature = "std"))]
extern crate ink_alloc;

#[cfg(not(feature = "std"))]
extern crate alloc;

#[cfg(all(test, feature = "std"))]
mod test_utils;

mod byte_utils;
pub mod env;
pub mod env2;
pub mod memory;
pub mod storage;

// Needed for derive macros of `core/derive` sub crate.
Expand Down
73 changes: 0 additions & 73 deletions core/src/memory.rs

This file was deleted.

11 changes: 5 additions & 6 deletions core/src/storage/cell/raw_cell.rs
Expand Up @@ -12,14 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use scale::{
Decode,
Encode,
};

use crate::{
env,
memory::vec::Vec,
storage::{
alloc::{
Allocate,
Expand All @@ -29,6 +23,11 @@ use crate::{
NonCloneMarker,
},
};
use ink_prelude::vec::Vec;
use scale::{
Decode,
Encode,
};

/// A raw cell.
///
Expand Down

0 comments on commit 609210f

Please sign in to comment.