-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incorporate changes made to Substrate version of MaxEncodedLen
Note: doesn't include the MaxEncodedLen impl for H160, H256, H512. A substrate companion will be necessary to re-add those.
- Loading branch information
1 parent
ccfa540
commit 9f24e9d
Showing
23 changed files
with
308 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod(foo())] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expect: path::to::crate | ||
--> $DIR/list_list_item.rs:4:23 | ||
| | ||
4 | #[max_encoded_len_mod(foo())] | ||
| ^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/list_list_item.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod("frame_support::max_encoded_len")] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expected a path item, not a literal | ||
--> $DIR/literal_list_item.rs:4:23 | ||
| | ||
4 | #[max_encoded_len_mod("frame_support::max_encoded_len")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/literal_list_item.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod = "frame_support::max_encoded_len"] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expect: #[max_encoded_len_mod(path::to::crate)] | ||
--> $DIR/name_value_attr.rs:4:3 | ||
| | ||
4 | #[max_encoded_len_mod = "frame_support::max_encoded_len"] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/name_value_attr.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod(path = "frame_support::max_encoded_len")] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expect: path::to::crate | ||
--> $DIR/name_value_list_item.rs:4:23 | ||
| | ||
4 | #[max_encoded_len_mod(path = "frame_support::max_encoded_len")] | ||
| ^^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/name_value_list_item.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expect: #[max_encoded_len_mod(path::to::crate)] | ||
--> $DIR/no_path_list_items.rs:4:3 | ||
| | ||
4 | #[max_encoded_len_mod] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/no_path_list_items.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use parity_scale_codec::{Encode, MaxEncodedLen}; | ||
|
||
#[derive(Encode, MaxEncodedLen)] | ||
#[max_encoded_len_mod] | ||
struct Example; | ||
|
||
fn main() { | ||
let _ = Example::max_encoded_len(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
error: expect: #[max_encoded_len_mod(path::to::crate)] | ||
--> $DIR/path_attr.rs:4:3 | ||
| | ||
4 | #[max_encoded_len_mod] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0599]: no function or associated item named `max_encoded_len` found for struct `Example` in the current scope | ||
--> $DIR/path_attr.rs:8:19 | ||
| | ||
5 | struct Example; | ||
| --------------- function or associated item `max_encoded_len` not found for this | ||
... | ||
8 | let _ = Example::max_encoded_len(); | ||
| ^^^^^^^^^^^^^^^ function or associated item not found in `Example` | ||
| | ||
= help: items from traits can only be used if the trait is implemented and in scope | ||
= note: the following trait defines an item `max_encoded_len`, perhaps you need to implement it: | ||
candidate #1: `MaxEncodedLen` |
Oops, something went wrong.