Skip to content

Commit

Permalink
Improve structure
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Mar 17, 2021
1 parent cb54a77 commit bc131ca
Show file tree
Hide file tree
Showing 20 changed files with 354 additions and 269 deletions.
17 changes: 2 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ check-std:
cargo check --verbose --all-features --manifest-path crates/${crate}/Cargo.toml;
done

# Just needed as long as we have the `ink-experimental-engine` feature.
# We do not invoke `--all-features` here -- this would imply the feature
# `ink-experimental-engine`. So in order to still run the tests without the
# experimental engine feature we need this command.
- for crate in ${ALL_CRATES}; do
cargo check --verbose --features std --manifest-path crates/${crate}/Cargo.toml;
done

check-wasm:
stage: check
<<: *docker-env
Expand Down Expand Up @@ -208,13 +200,8 @@ clippy-std:
- job: check-std
artifacts: false
script:
# Just needed as long as we have the `ink-experimental-engine` feature:
# `--all-features` here implies the feature `ink-experimental-engine`.
# So in order to still run the tests without the experimental engine
# feature we need to explicitly run with `std`.
- for crate in ${ALL_CRATES}; do
cargo clippy --verbose --all-features --manifest-path crates/${crate}/Cargo.toml -- -D warnings;
cargo clippy --verbose --features std --manifest-path crates/${crate}/Cargo.toml -- -D warnings;
done

clippy-wasm:
Expand Down Expand Up @@ -258,9 +245,9 @@ examples-test-experimental-engine:
- job: clippy-std
artifacts: false
script:
# we test only the examples for which the tests have already been migrated to
# We test only the examples for which the tests have already been migrated to
# use the experimental engine.
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path erc20/Cargo.toml
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path examples/erc20/Cargo.toml

examples-fmt:
stage: examples
Expand Down
6 changes: 0 additions & 6 deletions crates/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,18 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
[dependencies]
scale = { package = "parity-scale-codec", version = "2.0", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
num-traits = { version = "0.2", default-features = false, features = ["i128"] }
paste = "1.0"

sha2 = { version = "0.9" }
sha3 = { version = "0.9" }
blake2 = { version = "0.9" }

rand = { version = "0.8", default-features = false, features = ["alloc"], optional = true }
scale-info = { version = "0.6", default-features = false, features = ["derive"], optional = true }

[features]
default = ["std"]
std = [
"scale/std",
"scale-info",
"scale-info/std",
"rand",
"rand/std",
"rand/std_rng",
"num-traits/std",
]
27 changes: 0 additions & 27 deletions crates/engine/src/accounts.rs

This file was deleted.

12 changes: 9 additions & 3 deletions crates/engine/src/exec_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,25 @@
// limitations under the License.

use super::{
types::AccountId,
OffChainError,
types::{
AccountId,
Balance,
},
Error,
};

pub type Result<T> = core::result::Result<T, OffChainError>;
type Result<T> = core::result::Result<T, Error>;

/// The context of a contract execution.
pub struct ExecContext {
/// The caller of the contract execution.
///
/// Might be user or another contract.
pub caller: AccountId,
/// The callee of the contract execution.
pub callee: AccountId,
/// The value transferred to the contract as part of the call.
pub value_transferred: Balance,
}

impl ExecContext {
Expand Down
Loading

0 comments on commit bc131ca

Please sign in to comment.