Unverified Commit 702b4d36 authored by Hero Bird's avatar Hero Bird Committed by GitHub
Browse files

Update README, repair symbol links and simplify license headers (#498)

* [chores] update README to new ink! 3.0 syntax

* [*] update all broken LICENSE and README.md symbolic links

* [*] update all license headers

Also be more strict about their dates: 2018-2020 for all
parent 31276d89
Pipeline #109021 passed with stages
in 8 minutes and 5 seconds
// Copyright {20\d{2}}-{20\d{2}} Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
...@@ -86,13 +86,13 @@ Below you can see the code using the `ink_lang` version of ink!. ...@@ -86,13 +86,13 @@ Below you can see the code using the `ink_lang` version of ink!.
```rust ```rust
use ink_lang as ink; use ink_lang as ink;
#[ink::contract(version = "0.1.0")] #[ink::contract]
mod flipper { mod flipper {
use ink_core::storage; use ink_core::storage;
/// The storage of the flipper contract. /// The storage of the flipper contract.
#[ink(storage)] #[ink(storage)]
struct Flipper { pub struct Flipper {
/// The single `bool` value. /// The single `bool` value.
value: bool, value: bool,
} }
...@@ -100,7 +100,7 @@ mod flipper { ...@@ -100,7 +100,7 @@ mod flipper {
impl Flipper { impl Flipper {
/// Instantiates a new Flipper contract and initializes `value` to `init_value`. /// Instantiates a new Flipper contract and initializes `value` to `init_value`.
#[ink(constructor)] #[ink(constructor)]
fn new(init_value: bool) -> Self { pub fn new(init_value: bool) -> Self {
Self { Self {
value: init_value, value: init_value,
} }
...@@ -108,35 +108,30 @@ mod flipper { ...@@ -108,35 +108,30 @@ mod flipper {
/// Instantiates a new Flipper contract and initializes `value` to `false` by default. /// Instantiates a new Flipper contract and initializes `value` to `false` by default.
#[ink(constructor)] #[ink(constructor)]
fn default() -> Self { pub fn default() -> Self {
Self::new(false) Self::new(false)
} }
/// Flips `value` from `true` to `false` or vice versa. /// Flips `value` from `true` to `false` or vice versa.
#[ink(message)] #[ink(message)]
fn flip(&mut self) { pub fn flip(&mut self) {
self.value = !self.value; self.value = !self.value;
} }
/// Returns the current state of `value`. /// Returns the current state of `value`.
#[ink(message)] #[ink(message)]
fn get(&self) -> bool { pub fn get(&self) -> bool {
self.value self.value
} }
} }
/// As in normal Rust code we are able to define tests like below. /// Simply execute `cargo test` in order to test your contract using the below unit tests.
///
/// Simply execute `cargo test` in order to test your contract.
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
#[test] #[test]
fn default_works() { fn default_works() {
// Note that `#[ink(constructor)]` functions that above have been
// defined as `&mut self` can be used as normal Rust constructors
// in test mode.
let flipper = Flipper::default(); let flipper = Flipper::default();
assert_eq!(flipper.get(), false); assert_eq!(flipper.get(), false);
} }
......
../LICENSE ../../LICENSE
\ No newline at end of file \ No newline at end of file
../README.md ../../README.md
\ No newline at end of file \ No newline at end of file
../LICENSE ../../LICENSE
\ No newline at end of file \ No newline at end of file
../README.md ../../README.md
\ No newline at end of file \ No newline at end of file
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // Copyright 2018-2020 Parity Technologies (UK) Ltd.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
......
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