[chores] Rename all of `pdsl_*` to `ink_*` in the entire codebase

parent 17f448c3
......@@ -17,9 +17,9 @@ Please follow our simple commit style guidelines.
1. Prepend all commits with a topic.
Available topics are:
- `[core]` For changes to `pdsl_core`
- `[model]` For changes to `pdsl_model`
- `[lang]` For changes to `pdsl_lang`
- `[core]` For changes to `ink_core`
- `[model]` For changes to `ink_model`
- `[lang]` For changes to `ink_lang`
- `[cli]` For changes to `cargo-pdsl` also known as `pdsl_cli`
- `[ci]` For changes to the continuous integration.
- `[chores]` For general non-technical changes.
......
......@@ -17,10 +17,10 @@
[E2]: https://github.com/Aaronepower/tokei#badges
[F1]: https://img.shields.io/badge/docs-nightly-black.svg
[F2]: https://paritytech.github.io/ink/pdsl_core/index.html
[F2]: https://paritytech.github.io/ink/ink_core/index.html
[G1]: https://img.shields.io/badge/docs-nightly-purple.svg
[G2]: https://paritytech.github.io/ink/pdsl_model/index.html
[G2]: https://paritytech.github.io/ink/ink_model/index.html
**IMPORTANT NOTE:** WORK IN PROGRESS! Do not expect this to be working.
......@@ -101,7 +101,7 @@ contract! {
| `cli` | A minimalist tool to setup a smart contract project easily. |
| `core` | The core utilities used to write smart contracts. |
| `model` | Medium-level abstractions to write smart contracts heavily inspired by [Fleetwood](https://github.com/paritytech/fleetwood). |
| `lang` | The actual eDSL based on `pdsl_core` and `pdsl_model` to provide a user friendly interface to writing smart contract code. |
| `lang` | The actual eDSL based on `ink_core` and `ink_model` to provide a user friendly interface to writing smart contract code. |
| `examples` | Features some smart contracts written for clarity with focus on teaching users how to use pDSL to write their own contracts. |
## Contribution
......@@ -111,3 +111,4 @@ Visit our [contribution guidelines](CONTRIBUTING.md) for more information.
## License
The entire code within this repository is licensed under the [GLP-v3](LICENSE). Please [contact us](https://www.parity.io/contact/) if you have questions about the licensing of our products.
of our products.
......@@ -42,9 +42,9 @@ authors = ["[your_name] <[your_email]>"]
edition = "2018"
[dependencies]
pdsl_core = {{ git = "https://github.com/paritytech/ink", package = "pdsl_core" }}
pdsl_model = {{ git = "https://github.com/paritytech/ink", package = "pdsl_model" }}
pdsl_lang = {{ git = "https://github.com/paritytech/ink", package = "pdsl_lang" }}
ink_core = {{ git = "https://github.com/paritytech/ink", package = "ink_core" }}
ink_model = {{ git = "https://github.com/paritytech/ink", package = "ink_model" }}
ink_lang = {{ git = "https://github.com/paritytech/ink", package = "ink_lang" }}
parity-codec = {{ version = "3.3", default-features = false, features = ["derive"] }}
[lib]
......@@ -54,12 +54,12 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = [
"pdsl_core/test-env",
"pdsl_model/test-env",
"pdsl_lang/test-env",
"ink_core/test-env",
"ink_model/test-env",
"ink_lang/test-env",
]
generate-api-description = [
"pdsl_lang/generate-api-description"
"ink_lang/generate-api-description"
]
[profile.release]
......@@ -101,8 +101,8 @@ fn lib_rs_contents(name: &str) -> String {
format!(
r##"#![no_std]
use pdsl_core::storage;
use pdsl_lang::contract;
use ink_core::storage;
use ink_lang::contract;
contract! {{
/// This simple dummy contract has a `bool` value that can
......
[package]
name = "pdsl_core"
name = "ink_core"
version = "0.1.0"
authors = ["Robin Freyler <robin@parity.io>", "Parity Technologies <admin@parity.io>"]
edition = "2018"
......@@ -18,7 +18,7 @@ categories = ["no-std", "embedded"]
include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
[dependencies]
pdsl_utils = { path = "../utils/" }
ink_utils = { path = "../utils/" }
parity-codec = { version = "3.2", default-features = false, features = ["derive", "full"] }
log = "0.4"
wee_alloc = { version = "0.4", default-features = false }
......
......@@ -34,7 +34,7 @@ pub extern "C" fn oom(_: Layout) -> ! {
/// This is only required in non wasm32-unknown-unknown targets.
///
/// Since pdsl_core is targeted for wasm32-unknown-unknown we should
/// Since ink_core is targeted for wasm32-unknown-unknown we should
/// maybe remove this.
#[lang = "eh_personality"]
extern "C" fn eh_personality() {}
......@@ -142,7 +142,7 @@ impl CellChunkAlloc {
let index = self.key_to_cell_index(key);
log::info!(target: CC_ALLOC_LOG_TARGET, "deallocate cell at {:?}", key,);
self.cells.take(index).expect(
"[pdsl_core::CellChunkAlloc::dealloc_cell] Error: \
"[ink_core::CellChunkAlloc::dealloc_cell] Error: \
key was not allocated by the allocator",
)
}
......@@ -152,7 +152,7 @@ impl CellChunkAlloc {
let index = self.key_to_chunk_index(key);
log::info!(target: CC_ALLOC_LOG_TARGET, "deallocate chunk at {:?}", key,);
self.chunks.take(index).expect(
"[pdsl_core::CellChunkAlloc::dealloc_chunk] Error: \
"[ink_core::CellChunkAlloc::dealloc_chunk] Error: \
key was not allocated by the allocator",
)
}
......
......@@ -181,7 +181,7 @@ impl<T> CacheEntry<T> {
match self {
CacheEntry::Desync => {
panic!(
"[pdsl_core::sync_cell::CacheEntry::get] Error: \
"[ink_core::sync_cell::CacheEntry::get] Error: \
tried to get the value from a desync cache"
)
}
......@@ -198,7 +198,7 @@ impl<T> CacheEntry<T> {
match self {
CacheEntry::Desync => {
panic!(
"[pdsl_core::sync_cell::CacheEntry::get_mut] Error: \
"[ink_core::sync_cell::CacheEntry::get_mut] Error: \
tried to get the value from a desync cache"
)
}
......
......@@ -148,7 +148,7 @@ where
T::decode(&mut &loaded[..])
// Maybe we should return an error instead of panicking.
.expect(
"[pdsl_core::TypedChunkCell::load] Error: \
"[ink_core::TypedChunkCell::load] Error: \
failed upon decoding"
)
})
......
......@@ -32,7 +32,7 @@ use core::{
borrow::Borrow,
hash::Hash,
};
use pdsl_utils::hash;
use ink_utils::hash;
/// Mapping stored in the contract storage.
///
......@@ -198,7 +198,7 @@ where
None
}
None => {
panic!("[pdsl_core::HashMap::insert] Error: failed finding a valid entry")
panic!("[ink_core::HashMap::insert] Error: failed finding a valid entry")
}
}
}
......@@ -285,7 +285,7 @@ where
// of the key into a big-endian unsigned integer.
let probe_start = u32::from_be_bytes(
slice_as_array4(&(hash::keccak256(key.borrow())[0..4])).expect(
"[pdsl_core::HashMap::insert] Error \
"[ink_core::HashMap::insert] Error \
couldn't convert to probe_start byte array",
),
);
......@@ -362,7 +362,7 @@ where
Q: Hash + Eq + ?Sized,
{
let probe_index = self.probe_inspecting(key).expect(
"[pdsl_core::HashMap::remove] Error: \
"[ink_core::HashMap::remove] Error: \
failed at finding a valid entry",
);
match self.entries.take(probe_index) {
......@@ -454,7 +454,7 @@ where
fn index(&self, index: &Q) -> &Self::Output {
self.get(index).expect(
"[pdsl_core::HashMap::index] Error: \
"[ink_core::HashMap::index] Error: \
expected `index` to be within bounds",
)
}
......@@ -468,7 +468,7 @@ where
{
fn index_mut(&mut self, index: &Q) -> &mut Self::Output {
self.get_mut(index).expect(
"[pdsl_core::HashMap::index_mut] Error: \
"[ink_core::HashMap::index_mut] Error: \
expected `index` to be within bounds",
)
}
......
......@@ -349,13 +349,13 @@ where
.entries
.put(current_vacant, Entry::Occupied(val))
.expect(
"[pdsl_core::Stash::put] Error: \
"[ink_core::Stash::put] Error: \
expected a vacant entry here, but no entry was found",
) {
Entry::Vacant(next_vacant) => next_vacant,
Entry::Occupied(_) => {
unreachable!(
"[pdsl_core::Stash::put] Error: \
"[ink_core::Stash::put] Error: \
a next_vacant index can never point to an occupied entry"
)
}
......@@ -375,7 +375,7 @@ where
.entries
.put(n, Entry::Vacant(self.next_vacant()))
.expect(
"[pdsl_core::Stash::take] Error: \
"[ink_core::Stash::take] Error: \
we already asserted that the entry at `n` exists",
) {
Entry::Occupied(val) => {
......@@ -386,7 +386,7 @@ where
}
Entry::Vacant(_) => {
unreachable!(
"[pdsl_core::Stash::take] Error: \
"[ink_core::Stash::take] Error: \
we already asserted that the entry is occupied"
)
}
......
......@@ -233,7 +233,7 @@ where
pub fn push(&mut self, val: T) {
if self.len() == u32::max_value() {
panic!(
"[pdsl_core::Vec::push] Error: \
"[ink_core::Vec::push] Error: \
cannot push more elements than `u32::MAX`"
)
}
......@@ -262,7 +262,7 @@ where
{
self.within_bounds(n).and_then(|n| {
Some(self.cells.put(n, f()).expect(
"[pdsl_core::Vec::replace] Error: \
"[ink_core::Vec::replace] Error: \
expected success due to access within bounds",
))
})
......@@ -279,19 +279,19 @@ where
return
}
self.within_bounds(a).expect(
"[pdsl_core::Vec::swap] Error: \
"[ink_core::Vec::swap] Error: \
expected a to be within bounds",
);
self.within_bounds(b).expect(
"[pdsl_core::Vec::swap] Error: \
"[ink_core::Vec::swap] Error: \
expected b to be within bounds",
);
let item_a = self.cells.take(a).expect(
"[pdsl_core::Vec::swap] Error: \
"[ink_core::Vec::swap] Error: \
expected succes due to `a` being within bounds",
);
let item_b = self.cells.put(b, item_a).expect(
"[pdsl_core::Vec::swap] Error: \
"[ink_core::Vec::swap] Error: \
expected success due to `b` being within bounds",
);
self.cells.set(a, item_b);
......@@ -311,11 +311,11 @@ where
}
self.within_bounds(n)?;
let popped = self.pop().expect(
"[pdsl_core::Vec::swap_remove] Error: \
"[ink_core::Vec::swap_remove] Error: \
expected `Some` value since vector is not empty",
);
Some(self.cells.put(n, popped).expect(
"[pdsl_core::Vec::swap_remove] Error: \
"[ink_core::Vec::swap_remove] Error: \
expected success since the vector is not empty",
))
}
......@@ -329,7 +329,7 @@ where
fn index(&self, index: u32) -> &Self::Output {
self.get(index).expect(
"[pdsl_core::Vec::index] Error: \
"[ink_core::Vec::index] Error: \
expected `index` to be within bounds",
)
}
......@@ -341,7 +341,7 @@ where
{
fn index_mut(&mut self, index: u32) -> &mut Self::Output {
self.get_mut(index).expect(
"[pdsl_core::Vec::index] Error: \
"[ink_core::Vec::index] Error: \
expected `index` to be within bounds",
)
}
......
......@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
ink_core = { path = "../../../core" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -14,7 +14,7 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = ["pdsl_core/test-env"]
test-env = ["ink_core/test-env"]
[profile.release]
panic = "abort"
......
......@@ -20,7 +20,7 @@ use parity_codec::{
Decode,
Encode,
};
use pdsl_core::{
use ink_core::{
env::{
self,
Address,
......
......@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
ink_core = { path = "../../../core" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -14,7 +14,7 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = ["pdsl_core/test-env"]
test-env = ["ink_core/test-env"]
[profile.release]
panic = "abort"
......
......@@ -17,7 +17,7 @@
#![cfg_attr(not(all(test, feature = "test-env")), no_std)]
use parity_codec::Decode;
use pdsl_core::{
use ink_core::{
env::{
ContractEnv,
Env,
......@@ -36,7 +36,7 @@ use pdsl_core::{
};
// #[cfg(not(test))]
// use pdsl_core::println;
// use ink_core::println;
/// An incrementer smart contract.
///
......
......@@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
ink_core = { path = "../../../core" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -15,7 +15,7 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = ["pdsl_core/test-env"]
test-env = ["ink_core/test-env"]
[profile.release]
panic = "abort"
......
......@@ -16,12 +16,12 @@
#![no_std]
// use pdsl_core::{
// use ink_core::{
// env::{Env, ContractEnv},
// };
#[allow(unused)]
use pdsl_core;
use ink_core;
#[no_mangle]
pub extern "C" fn deploy() {
......
......@@ -5,7 +5,7 @@ authors = ["Robin Freyler <robin@parity.io>", "Parity Technologies <admin@parity
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
ink_core = { path = "../../../core" }
parity-codec = { version = "3.2", default-features = false, features = ["derive", "full"] }
[lib]
......@@ -14,7 +14,7 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = ["pdsl_core/test-env"]
test-env = ["ink_core/test-env"]
[profile.release]
panic = "abort"
......
......@@ -23,7 +23,7 @@ use parity_codec::{
Decode,
Encode,
};
use pdsl_core::{
use ink_core::{
env::{
srml::Address,
ContractEnv,
......@@ -72,7 +72,7 @@ pub struct UserData {
impl AllocateUsing for UserData {
unsafe fn allocate_using<A>(alloc: &mut A) -> Self
where
A: pdsl_core::storage::alloc::Allocate,
A: ink_core::storage::alloc::Allocate,
{
Self {
owner: Address::from(&[0x0; 32][..]),
......@@ -110,7 +110,7 @@ pub struct Subpeep {
impl AllocateUsing for Subpeep {
unsafe fn allocate_using<A>(alloc: &mut A) -> Self
where
A: pdsl_core::storage::alloc::Allocate,
A: ink_core::storage::alloc::Allocate,
{
Self {
peeps: storage::Vec::allocate_using(alloc),
......
......@@ -16,7 +16,7 @@
use super::*;
use pdsl_core::memory::vec::Vec;
use ink_core::memory::vec::Vec;
impl Subpeep {
/// Returns all recent global posts as vector.
......@@ -45,7 +45,7 @@ impl Subpeep {
}
#[macro_use]
use pdsl_core::memory::vec;
use ink_core::memory::vec;
#[test]
fn deploy() {
......
......@@ -5,9 +5,9 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
pdsl_model = { path = "../../../model" }
pdsl_lang = { path = "../../../lang" }
ink_core = { path = "../../../core" }
ink_model = { path = "../../../model" }
ink_lang = { path = "../../../lang" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -16,15 +16,15 @@ crate-type = ["cdylib"]
[features]
default = [
"pdsl_lang/generate-api-description"
"ink_lang/generate-api-description"
]
test-env = [
"pdsl_core/test-env",
"pdsl_model/test-env",
"pdsl_lang/test-env",
"ink_core/test-env",
"ink_model/test-env",
"ink_lang/test-env",
]
generate-api-description = [
"pdsl_lang/generate-api-description"
"ink_lang/generate-api-description"
]
[profile.release]
......
......@@ -20,7 +20,7 @@ use parity_codec::{
Decode,
Encode,
};
use pdsl_core::{
use ink_core::{
env::{
self,
Address,
......@@ -29,7 +29,7 @@ use pdsl_core::{
memory::format,
storage,
};
use pdsl_lang::contract;
use ink_lang::contract;
/// Events deposited by the ERC20 token contract.
#[derive(Encode, Decode)]
......
......@@ -5,12 +5,12 @@ authors = ["[your_name] <[your_email]>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
pdsl_model = { path = "../../../model" }
pdsl_lang = { path = "../../../lang" }
# pdsl_core = { git = "https://github.com/Robbepop/pdsl", package = "pdsl_core" }
# pdsl_model = { git = "https://github.com/Robbepop/pdsl", package = "pdsl_model" }
# pdsl_lang = { git = "https://github.com/Robbepop/pdsl", package = "pdsl_lang" }
ink_core = { path = "../../../core" }
ink_model = { path = "../../../model" }
ink_lang = { path = "../../../lang" }
# ink_core = { git = "https://github.com/Robbepop/pdsl", package = "ink_core" }
# ink_model = { git = "https://github.com/Robbepop/pdsl", package = "ink_model" }
# ink_lang = { git = "https://github.com/Robbepop/pdsl", package = "ink_lang" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -20,12 +20,12 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = [
"pdsl_core/test-env",
"pdsl_model/test-env",
"pdsl_lang/test-env",
"ink_core/test-env",
"ink_model/test-env",
"ink_lang/test-env",
]
generate-api-description = [
"pdsl_lang/generate-api-description"
"ink_lang/generate-api-description"
]
[profile.release]
......
#![no_std]
use pdsl_core::{
use ink_core::{
memory::format,
storage,
};
use pdsl_lang::contract;
use ink_lang::contract;
contract! {
/// A simple incrementer contract that can only increment,
......
......@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
pdsl_model = { path = "../../../model" }
ink_core = { path = "../../../core" }
ink_model = { path = "../../../model" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -16,8 +16,8 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = [
"pdsl_core/test-env",
"pdsl_model/test-env",
"ink_core/test-env",
"ink_model/test-env",
]
[profile.release]
......
......@@ -16,14 +16,14 @@
#![no_std]
use pdsl_core::{
use ink_core::{
env::{
Address,
Balance,
},
storage,
};
use pdsl_model::{
use ink_model::{
messages,
state,
Contract,
......
......@@ -5,8 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
pdsl_core = { path = "../../../core" }
pdsl_model = { path = "../../../model" }
ink_core = { path = "../../../core" }
ink_model = { path = "../../../model" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
[lib]
......@@ -16,8 +16,8 @@ crate-type = ["cdylib"]
[features]
default = []
test-env = [
"pdsl_core/test-env",
"pdsl_model/test-env",
"ink_core/test-env",
"ink_model/test-env",
]
[profile.release]
......
......@@ -16,8 +16,8 @@
#![no_std]
use pdsl_core::storage;
use pdsl_model::{
use ink_core::storage;
use ink_model::{
messages,
state,
Contract,
......
[package]
name = "pdsl_lang"
name = "ink_lang"
version = "0.1.0"
authors = ["Herobird <robbepop@web.de>"]
edition = "2018"
......@@ -18,8 +18,8 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
[dependencies]
pdsl_utils = { path = "../utils/" }
pdsl_model = { path = "../model/" }
ink_utils = { path = "../utils/" }
ink_model = { path = "../model/" }
parity-codec = { version = "3.2", default-features = false, features = ["derive"] }
quote = "0.6"
......@@ -35,16 +35,16 @@ serde_json = "1.0.39"
pretty_assertions = "0.6.1"
[lib]
name = "pdsl_lang"
name = "ink_lang"
proc-macro = true
[features]
default = []
std = [
"pdsl_utils/std",
"ink_utils/std",
"parity-codec/std",
]
test-env = [
"pdsl_model/test-env",
"ink_model/test-env",
]
generate-api-description = []
......@@ -239,9 +239,9 @@ impl FnDecl {
inputs_with_env.push_value(self_arg.clone());
inputs_with_env.push_punct(Default::default());
let custom_arg_captured: ArgCaptured = if self.kind() == FnDeclKind::SelfRefMut {
syn::parse_quote! { env: &mut pdsl_model::EnvHandler }