Unverified Commit fc424c23 authored by Andrew Jones's avatar Andrew Jones Committed by GitHub
Browse files

[examples] remove config made redundant by cargo-contract (#456)

* Incrementer

* DNS

* ERC 20

* [examples] set all crate-types to cdylib

* [examples] delegator

* [examples] remove remaining abi and profile.release cruft

* Restore rlib to delegator dependencies

* Remove redundant reexports

* Restore reexports for delegator sub contracts

* Fix type

* Install version of cargo-contract from branch

* Use cargo-contract ink-ci branch

* dns crate type
parent cf6e7106
Pipeline #98199 failed with stages
in 10 minutes and 4 seconds
...@@ -166,8 +166,10 @@ fmt: ...@@ -166,8 +166,10 @@ fmt:
#### stage: examples #### stage: examples
.update-cargo-contract: &update-cargo-contract .update-cargo-contract: &update-cargo-contract
# `cargo install` returns an error if there is nothing to update, so have to supress it here temporarily # `cargo install` returns an error if there is nothing to update, so have to suppress it here temporarily
- cargo install cargo-contract || echo $? # restore this once ink! 3.0 is published and the new version of cargo-contract has been released to crates.io
# - cargo install cargo-contract || echo $?
- cargo install --git https://github.com/paritytech/cargo-contract --tag ink-ci || echo $?
- cargo contract -V - cargo contract -V
examples-test: examples-test:
......
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
ink_abi = { path = "../../../../abi" }
contract = { path = "../..", package = "delegator" }
ink_lang = { path = "../../../../lang" }
serde = "1.0"
serde_json = "1.0"
extern crate contract;
extern "Rust" {
fn __ink_generate_metadata() -> ink_abi::InkProject;
}
fn main() -> Result<(), std::io::Error> {
let ink_project = unsafe { __ink_generate_metadata() };
let contents = serde_json::to_string_pretty(&ink_project)?;
std::fs::create_dir("target").ok();
std::fs::write("target/metadata.json", contents)?;
Ok(())
}
...@@ -20,12 +20,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"], ...@@ -20,12 +20,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"],
[lib] [lib]
name = "delegator" name = "delegator"
path = "lib.rs" path = "lib.rs"
crate-type = [ crate-type = ["cdylib"]
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features] [features]
default = ["std"] default = ["std"]
...@@ -45,20 +40,9 @@ std = [ ...@@ -45,20 +40,9 @@ std = [
] ]
ink-as-dependency = [] ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
codegen-units = 1
[workspace] [workspace]
members = [ members = [
".ink/abi_gen",
"accumulator", "accumulator",
"adder", "adder",
"subber", "subber",
] ]
exclude = [
".ink"
]
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
pub use self::delegator::Delegator;
use ink_lang as ink; use ink_lang as ink;
#[ink::contract(version = "0.1.0")] #[ink::contract(version = "0.1.0")]
......
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
ink_abi = { path = "../../../../abi" }
contract = { path = "../..", package = "dns" }
ink_lang = { path = "../../../../lang" }
serde = "1.0"
serde_json = "1.0"
extern crate contract;
extern "Rust" {
fn __ink_generate_metadata() -> ink_abi::InkProject;
}
fn main() -> Result<(), std::io::Error> {
let ink_project = unsafe { __ink_generate_metadata() };
let contents = serde_json::to_string_pretty(&ink_project)?;
std::fs::create_dir("target").ok();
std::fs::write("target/metadata.json", contents)?;
Ok(())
}
...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"], ...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"],
[lib] [lib]
name = "dns" name = "dns"
path = "lib.rs" path = "lib.rs"
crate-type = [ crate-type = ["cdylib"]
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features] [features]
default = ["std"] default = ["std"]
...@@ -36,18 +31,3 @@ std = [ ...@@ -36,18 +31,3 @@ std = [
"scale-info/std", "scale-info/std",
] ]
ink-as-dependency = [] ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
codegen-units = 1
[workspace]
members = [
".ink/abi_gen"
]
exclude = [
".ink"
]
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
pub use self::dns::DomainNameService;
use ink_lang as ink; use ink_lang as ink;
#[ink::contract(version = "0.1.0")] #[ink::contract(version = "0.1.0")]
......
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
ink_abi = { path = "../../../../abi" }
contract = { path = "../..", package = "erc20" }
ink_lang = { path = "../../../../lang" }
serde = "1.0"
serde_json = "1.0"
extern crate contract;
extern "Rust" {
fn __ink_generate_metadata() -> ink_abi::InkProject;
}
fn main() -> Result<(), std::io::Error> {
let ink_project = unsafe { __ink_generate_metadata() };
let contents = serde_json::to_string_pretty(&ink_project)?;
std::fs::create_dir("target").ok();
std::fs::write("target/metadata.json", contents)?;
Ok(())
}
...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"], ...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"],
[lib] [lib]
name = "erc20" name = "erc20"
path = "lib.rs" path = "lib.rs"
crate-type = [ crate-type = ["cdylib"]
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features] [features]
default = ["std"] default = ["std"]
...@@ -36,18 +31,3 @@ std = [ ...@@ -36,18 +31,3 @@ std = [
"scale-info/std", "scale-info/std",
] ]
ink-as-dependency = [] ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
codegen-units = 1
[workspace]
members = [
".ink/abi_gen"
]
exclude = [
".ink"
]
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
pub use self::erc20::Erc20;
use ink_lang as ink; use ink_lang as ink;
#[ink::contract(version = "0.1.0")] #[ink::contract(version = "0.1.0")]
......
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
ink_abi = { path = "../../../../abi" }
contract = { path = "../..", package = "erc721" }
ink_lang = { path = "../../../../lang" }
serde = "1.0"
serde_json = "1.0"
extern crate contract;
extern "Rust" {
fn __ink_generate_metadata() -> ink_abi::InkProject;
}
fn main() -> Result<(), std::io::Error> {
let ink_project = unsafe { __ink_generate_metadata() };
let contents = serde_json::to_string_pretty(&ink_project)?;
std::fs::create_dir("target").ok();
std::fs::write("target/metadata.json", contents)?;
Ok(())
}
...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"], ...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"],
[lib] [lib]
name = "erc721" name = "erc721"
path = "lib.rs" path = "lib.rs"
crate-type = [ crate-type = ["cdylib"]
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features] [features]
default = ["std"] default = ["std"]
...@@ -36,18 +31,3 @@ std = [ ...@@ -36,18 +31,3 @@ std = [
"scale-info/std", "scale-info/std",
] ]
ink-as-dependency = [] ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
codegen-units = 1
[workspace]
members = [
".ink/abi_gen"
]
exclude = [
".ink"
]
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
pub use self::erc721::Erc721;
use ink_lang as ink; use ink_lang as ink;
#[ink::contract(version = "0.1.0")] #[ink::contract(version = "0.1.0")]
......
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
ink_abi = { path = "../../../../abi" }
contract = { path = "../..", package = "flipper" }
ink_lang = { path = "../../../../lang" }
serde = "1.0"
serde_json = "1.0"
extern crate contract;
extern "Rust" {
fn __ink_generate_metadata() -> ink_abi::InkProject;
}
fn main() -> Result<(), std::io::Error> {
let ink_project = unsafe { __ink_generate_metadata() };
let contents = serde_json::to_string_pretty(&ink_project)?;
std::fs::create_dir("target").ok();
std::fs::write("target/metadata.json", contents)?;
Ok(())
}
...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"], ...@@ -16,12 +16,7 @@ scale-info = { version = "0.2", default-features = false, features = ["derive"],
[lib] [lib]
name = "flipper" name = "flipper"
path = "lib.rs" path = "lib.rs"
crate-type = [ crate-type = ["cdylib"]
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features] [features]
default = ["std"] default = ["std"]
...@@ -36,18 +31,3 @@ std = [ ...@@ -36,18 +31,3 @@ std = [
"scale-info/std", "scale-info/std",
] ]
ink-as-dependency = [] ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
codegen-units = 1
[workspace]
members = [
".ink/abi_gen"
]
exclude = [
".ink"
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment