Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
7 changes: 5 additions & 2 deletions crates/lang/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ pub fn selector_bytes(input: TokenStream) -> TokenStream {
///
/// An example for this is the following type that could potentially be used
/// within a contract's storage struct definition:
/// ```
/// // A storage vector of storage vectors.
///
///
/// ```ignore
/// # // Tracking issue [#1119]: Right now we've hidden the `StorageVec` from public access so
/// # // this doesn't compile.
/// # use ink_storage as storage;
/// # type _unused =
/// storage::Vec<storage::Vec<i32>>
Expand Down
11 changes: 4 additions & 7 deletions crates/lang/tests/ui/contract/pass/example-erc20-works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ use ink_lang as ink;
#[ink::contract]
mod erc20 {
use ink_storage::{
lazy::{
Lazy,
Mapping,
},
traits::SpreadAllocate,
Mapping,
};

/// A simple ERC-20 contract.
#[ink(storage)]
#[derive(SpreadAllocate)]
pub struct Erc20 {
/// Total token supply.
total_supply: Lazy<Balance>,
total_supply: Balance,
/// Mapping from owner to number of owned token.
balances: Mapping<AccountId, Balance>,
/// Mapping of the token amount which an account is allowed to withdraw
Expand Down Expand Up @@ -70,7 +67,7 @@ mod erc20 {
fn new_init(&mut self, initial_supply: Balance) {
let caller = Self::env().caller();
self.balances.insert(&caller, &initial_supply);
Lazy::set(&mut self.total_supply, initial_supply);
self.total_supply = initial_supply;
Self::env().emit_event(Transfer {
from: None,
to: Some(caller),
Expand All @@ -81,7 +78,7 @@ mod erc20 {
/// Returns the total token supply.
#[ink(message)]
pub fn total_supply(&self) -> Balance {
*self.total_supply
self.total_supply
}

/// Returns the account balance for the specified `owner`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use ink_lang as ink;
#[ink::contract]
mod erc721 {
use ink_storage::{
lazy::Mapping,
traits::SpreadAllocate,
Mapping,
};

use scale::{
Expand Down
38 changes: 0 additions & 38 deletions crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"],
cfg-if = "1.0"
array-init = { version = "2.0", default-features = false }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Workaround: we actually just need criterion as a dev-dependency, but
# there is an issue with a doubly included std lib when executing
# `cargo check --no-default-features --target wasm32-unknown-unknown`.
# We haven't found a better solution yet.
criterion = { version = "0.3", optional = true }

[dev-dependencies]
quickcheck = "1.0"
quickcheck_macros = "1.0"
Expand All @@ -43,7 +36,6 @@ paste = "1.0"
[features]
default = ["std"]
std = [
"criterion",
"ink_metadata",
"ink_metadata/std",
"ink_env/std",
Expand All @@ -55,33 +47,3 @@ std = [
]
ink-fuzz-tests = ["std"]
ink-experimental-engine = ["ink_env/ink-experimental-engine"]

[[bench]]
name = "bench_lazy"
path = "benches/bench_lazy.rs"
harness = false

[[bench]]
name = "bench_vec"
path = "benches/bench_vec.rs"
harness = false

[[bench]]
name = "bench_stash"
path = "benches/bench_stash.rs"
harness = false

[[bench]]
name = "bench_bitstash"
path = "benches/bench_bitstash.rs"
harness = false

[[bench]]
name = "bench_hashmap"
path = "benches/bench_hashmap.rs"
harness = false

[[bench]]
name = "bench_binary_heap"
path = "benches/bench_binary_heap.rs"
harness = false
221 changes: 0 additions & 221 deletions crates/storage/benches/bench_binary_heap.rs

This file was deleted.

Loading