Unverified Commit 1cfbe644 authored by Michael Müller's avatar Michael Müller Committed by GitHub
Browse files

Various fixes and improvements (#794)

* Fix nightly clippy warning for `from_iter_instead_of_collect`

* Fix broken discord link

* Improve `rand-extension` readme

* Link `ink-docs`
parent 4f229fc3
Pipeline #139190 failed with stages
in 7 minutes and 48 seconds
......@@ -25,7 +25,7 @@
[k1]: https://img.shields.io/badge/matrix-chat-brightgreen.svg?style=flat
[k2]: https://riot.im/app/#/room/#ink:matrix.parity.io
[l1]: https://img.shields.io/discord/722223075629727774?style=flat-square&label=discord
[l2]: https://discord.gg/ztCASQE
[l2]: https://discord.gg/HZJyAy4rrU
> <img src="./.images/ink-squid.svg" alt="squink, the ink! mascot" style="vertical-align: middle" align="left" height="60" />ink! is an [eDSL](https://wiki.haskell.org/Embedded_domain_specific_language) to write smart contracts in Rust for blockchains built on the [Substrate](https://github.com/paritytech/substrate) framework. ink! contracts are compiled to WebAssembly.
......
......@@ -61,7 +61,7 @@ impl FromIterator<bool> for StorageBitvec {
impl<'a> FromIterator<&'a bool> for StorageBitvec {
fn from_iter<T: IntoIterator<Item = &'a bool>>(iter: T) -> Self {
<Self as FromIterator<bool>>::from_iter(iter.into_iter().copied())
iter.into_iter().copied().collect()
}
}
......
# Chain-side Extension
# Chain Extension Example
## What is this example about?
It demonstrates how to call a custom Substrate function from ink!.
See [this chapter](https://paritytech.github.io/ink-docs/macros-attributes/chain-extension)
in our ink! documentation for more details.
There are two parts to this example:
* Defining and calling the extension in ink!.
* Defining the extension in Substrate.
## Chain-side Integration
To integrate this example into Substrate you need to do two things:
* Use the code in [`chain-extension-example.rs`](./chain-extension-example.rs) as an implementation for
the trait `ChainExtension` in Substrate.
* Use the code in [`chain-extension-example.rs`](runtime/chain-extension-example.rs)
as an implementation for the trait `ChainExtension` in Substrate.
You can just copy/paste the content of that file into e.g. your `runtime/src/lib.rs`.
* Use the implementation as the associated type `ChainExtension` of the trait
......@@ -15,3 +29,7 @@ To integrate this example into Substrate you need to do two things:
}
```
## ink! Integration
See the example contract in [`lib.rs`](lib.rs).
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