Commit ff723b1
Update to scale-info
* Bump scale-info requirement to 0.9
* Update manual TypeInfo impls
* Use decode feature of scale-info
* scale-info 1.0
* Fix tests, 0 indexing on type registry
* Update some missing examples
* TMP: use ink rc5 for compat with cargo-contract
* Update RELEASES.md
* Bump versions back to 1.0
* Introduce versioning of ink metadata format
* Update RELEASES.md
Co-authored-by: Michael Müller <michi@parity.io>
* Update crates/metadata/src/lib.rs
Co-authored-by: Michael Müller <michi@parity.io>
* Clippy: allow large enum variant
* [storage] Allow one variant enum to derive SpreadLayout (#942)
* [storage] Allow one variant enum to derive SpreadLayout
I have an enum that has only one variant, and I want to store the enum value in the storage. I might add new variants later in development, so the enum is not useless.
The current implementation doesn't allow to derive the `SpreadLayout` trait for one variant enums, and I fixed it on this PR.
# Sample code
```rust
#![cfg_attr(not(feature = "std"), no_std)]
use ink_lang as ink;
#[derive(
Copy,
Clone,
scale::Encode,
scale::Decode,
ink_storage::traits::SpreadLayout,
ink_storage::traits::PackedLayout,
)]
#[cfg_attr(
feature = "std",
derive(scale_info::TypeInfo, ink_storage::traits::StorageLayout)
)]
pub enum MyEnum {
A,
}
#[ink::contract]
mod enum_test {
use super::MyEnum;
#[ink(storage)]
pub struct EnumTest {
value: MyEnum,
}
impl EnumTest {
#[ink(constructor)]
pub fn new() -> Self {
Self { value: MyEnum::A }
}
#[ink(message)]
pub fn get(&self) -> MyEnum {
self.value
}
}
}
```
Without this change, I get this error.
```
$ cargo +nightly contract build
[1/5] Building cargo project
Updating crates.io index
Compiling enum_test v0.1.0 (/private/var/folders/zn/l2f569z56vnghtt524x1mv6w0000gn/T/cargo-contract_FM50JF)
error: proc-macro derive panicked
--> /snip/enum_test/lib.rs:10:5
|
10 | ink_storage::traits::SpreadLayout,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: can only operate on enums
```
* Update crates/storage/derive/src/spread_layout.rs
Co-authored-by: Robin Freyler <robbepop@web.de>
* cargo fmt
Co-authored-by: Robin Freyler <robbepop@web.de>
* CI: remove gcda files from cache (#943)
* Update pretty_assertions requirement from 0.7.1 to 1.0.0 (#944)
Updates the requirements on [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions) to permit the latest version.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases)
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](rust-pretty-assertions/rust-pretty-assertions@v0.7.1...v1.0.0)
---
updated-dependencies:
- dependency-name: pretty_assertions
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add 'versioning' to spellcheck dict
Co-authored-by: Michael Müller <michi@parity.io>
Co-authored-by: tash-2s <81064017+tash-2s@users.noreply.github.com>
Co-authored-by: Robin Freyler <robbepop@web.de>
Co-authored-by: Denis Pisarev <denis.pisarev@parity.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>1.0, introduce metadata format versioning (#845)1 parent 93d22fb commit ff723b1
File tree
31 files changed
+72
-40
lines changed- .config
- crates
- env
- lang
- codegen/src/generator
- macro
- metadata
- src
- layout
- primitives
- src
- storage
- src/alloc/boxed
- examples
- contract-terminate
- contract-transfer
- delegator
- accumulator
- adder
- subber
- dns
- erc1155
- erc20
- erc721
- flipper
- incrementer
- multisig_plain
- rand-extension
- trait-erc20
- trait-flipper
- trait-incrementer
31 files changed
+72
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
60 | 85 | | |
61 | 86 | | |
62 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
0 commit comments