Skip to content

Commit

Permalink
Prep to release 3.7.0 (#646)
Browse files Browse the repository at this point in the history
* Prep to release 3.7.1

* Consistify some fields and version across workspace

* require only derive 3.6.8 or above to avoid ddry-run CI issue. 3.7.1 should be selected anyway

* Go down to 3.7.0 - that version wasn't released yet

* Add other recent changes

* trailing newline

* Set MSRV to 1.79 since we get compile errors on earlier versions

* Add CountedInput to changelog

Co-authored-by: Guillaume Thiolliere <[email protected]>

* clippy

* update release date

---------

Co-authored-by: Guillaume Thiolliere <[email protected]>
  • Loading branch information
jsdw and gui1117 authored Nov 18, 2024
1 parent 2ef70dc commit 8cde4c8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this crate are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this crate adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.7.0] - 2024-11-18

### Added

- Allow decoding with a memory limit. ([616](https://github.com/paritytech/parity-scale-codec/pull/616))
- Introduce `CountedInput`, an wrapper on `Input` that counts the bytes read. ([630](https://github.com/paritytech/parity-scale-codec/pull/630))

### Changed

- This release bumps some dependencies, primarily bumping `syn` to 2. ([#640](https://github.com/paritytech/parity-scale-codec/pull/640)).

### Fixed

- Fix MaxEncodedLen derive macro for enum with skipped variant ([#622](https://github.com/paritytech/parity-scale-codec/pull/622))
- Use MAX_PREALLOCATION consistently [#605](https://github.com/paritytech/parity-scale-codec/pull/605)

## [3.6.4] - 2023-07-14

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
name = "parity-scale-codec"
description = "SCALE - Simple Concatenating Aggregated Little Endians"
version = "3.7.0"
authors = ["Parity Technologies <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/paritytech/parity-scale-codec"
categories = ["encoding"]
edition = "2021"
version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
categories.workspace = true
edition.workspace = true
build = "build.rs"
rust-version = "1.60.0"
rust-version.workspace = true

[dependencies]
arrayvec = { version = "0.7", default-features = false }
serde = { version = "1.0.215", default-features = false, optional = true }
parity-scale-codec-derive = { path = "derive", version = ">= 3.6.8", default-features = false, optional = true }
parity-scale-codec-derive = { path = "derive", version = "3.6.8", default-features = false, optional = true }
bitvec = { version = "1", default-features = false, features = ["alloc"], optional = true }
bytes = { version = "1", default-features = false, optional = true }
byte-slice-cast = { version = "1.2.2", default-features = false }
Expand Down Expand Up @@ -62,3 +62,12 @@ full = []

[workspace]
members = ["derive", "fuzzer"]

[workspace.package]
version = "3.7.0"
authors = ["Parity Technologies <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/paritytech/parity-scale-codec"
categories = ["encoding"]
edition = "2021"
rust-version = "1.79.0"
12 changes: 6 additions & 6 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "parity-scale-codec-derive"
description = "Serialization and deserialization derive macro for Parity SCALE Codec"
version = "3.6.8"
authors = ["Parity Technologies <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56.1"
repository = "https://github.com/paritytech/parity-scale-codec"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
proc-macro = true
Expand Down
6 changes: 2 additions & 4 deletions src/counted_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ impl<I: crate::Input> crate::Input for CountedInput<'_, I> {
}

fn read(&mut self, into: &mut [u8]) -> Result<(), crate::Error> {
self.input.read(into).map(|r| {
self.input.read(into).inspect(|_r| {
self.counter = self.counter.saturating_add(into.len().try_into().unwrap_or(u64::MAX));
r
})
}

fn read_byte(&mut self) -> Result<u8, crate::Error> {
self.input.read_byte().map(|r| {
self.input.read_byte().inspect(|_r| {
self.counter = self.counter.saturating_add(1);
r
})
}

Expand Down

0 comments on commit 8cde4c8

Please sign in to comment.