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");
// 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!.
```rust
use ink_lang as ink;
#[ink::contract(version = "0.1.0")]
#[ink::contract]
mod flipper {
use ink_core::storage;
/// The storage of the flipper contract.
#[ink(storage)]
struct Flipper {
pub struct Flipper {
/// The single `bool` value.
value: bool,
}
......@@ -100,7 +100,7 @@ mod flipper {
impl Flipper {
/// Instantiates a new Flipper contract and initializes `value` to `init_value`.
#[ink(constructor)]
fn new(init_value: bool) -> Self {
pub fn new(init_value: bool) -> Self {
Self {
value: init_value,
}
......@@ -108,35 +108,30 @@ mod flipper {
/// Instantiates a new Flipper contract and initializes `value` to `false` by default.
#[ink(constructor)]
fn default() -> Self {
pub fn default() -> Self {
Self::new(false)
}
/// Flips `value` from `true` to `false` or vice versa.
#[ink(message)]
fn flip(&mut self) {
pub fn flip(&mut self) {
self.value = !self.value;
}
/// Returns the current state of `value`.
#[ink(message)]
fn get(&self) -> bool {
pub fn get(&self) -> bool {
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.
/// Simply execute `cargo test` in order to test your contract using the below unit tests.
#[cfg(test)]
mod tests {
use super::*;
#[test]
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();
assert_eq!(flipper.get(), false);
}
......
../LICENSE
\ No newline at end of file
../../LICENSE
\ No newline at end of file
../README.md
\ No newline at end of file
../../README.md
\ No newline at end of file
../LICENSE
\ No newline at end of file
../../LICENSE
\ No newline at end of file
../README.md
\ No newline at end of file
../../README.md
\ 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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");
// 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