Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

More compact bytes serialization and code re-use. #15

Merged
merged 2 commits into from
Nov 11, 2017
Merged

Conversation

tomusdrw
Copy link
Contributor

No description provided.

@tomusdrw tomusdrw requested a review from arkpar November 11, 2017 10:52
S: Serializer,
{
let mut non_zero = bytes.len();
for (i, b) in bytes.iter().enumerate() {
Copy link
Member

@arkpar arkpar Nov 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be just bytes.iter().take_while(|b| *b == 0).count()

ErrorKind::InvalidLength(len) => E::invalid_length(len, &self),
})?;

let v = if v.len() % 2 == 0 { v[2..].to_owned() } else { format!("0{}", &v[2..]) };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer non-even length to be an error.

@arkpar arkpar merged commit de68ab0 into master Nov 11, 2017
@arkpar arkpar deleted the td-better-bytes branch November 11, 2017 12:22
iStrike7 referenced this pull request in gasp-xyz/substrate Aug 3, 2021
liuchengxu pushed a commit to chainx-org/substrate that referenced this pull request Aug 23, 2021
* Fix validator key error

* 1.add balance module
2.add gitignore

*  Support dev mod and local test mod(paritytech#15)

* Configure two validator Alice or Bob

* Support dev mod and local test mod

* 1.add balance module (paritytech#14)

2.add gitignore

* update gitignore

* fix genesis config

* update runtime privcall

* Fix genesis config  (paritytech#16)

* 1.add balance module
2.add gitignore

* update gitignore

* fix genesis config

* update runtime privcall

* add cargo.lock in runtime/wasm
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants