Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions primitive-types/impls/codec/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.5.1] - 2021-07-02
### Breaking
- Updated `parity-scale-codec` to 2.2. [#552](https://github.com/paritytech/parity-common/pull/552)

## [0.5.0] - 2021-01-27
### Breaking
- Updated `parity-scale-codec` to 2.0. [#510](https://github.com/paritytech/parity-common/pull/510)
4 changes: 2 additions & 2 deletions primitive-types/impls/codec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "impl-codec"
version = "0.5.0"
version = "0.5.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
description = "Parity Codec serialization support for uint and fixed hash."
edition = "2018"

[dependencies]
parity-scale-codec = { version = "2.0.0", default-features = false }
parity-scale-codec = { version = "2.2.0", default-features = false, features = ["max-encoded-len"] }

[features]
default = ["std"]
Expand Down
12 changes: 12 additions & 0 deletions primitive-types/impls/codec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ macro_rules! impl_uint_codec {
<[u8; $len * 8] as $crate::codec::Decode>::decode(input).map(|b| $name::from_little_endian(&b))
}
}

impl $crate::codec::MaxEncodedLen for $name {
fn max_encoded_len() -> usize {
::core::mem::size_of::<$name>()
}
}
};
}

Expand All @@ -52,5 +58,11 @@ macro_rules! impl_fixed_hash_codec {
<[u8; $len] as $crate::codec::Decode>::decode(input).map($name)
}
}

impl $crate::codec::MaxEncodedLen for $name {
fn max_encoded_len() -> usize {
::core::mem::size_of::<$name>()
}
}
};
}