Skip to content

Commit

Permalink
feat: make dag-pb spec compliant (#170)
Browse files Browse the repository at this point in the history
The DAG-PB codec is now spec compliant. The fixtures
at https://github.com/ipld/codec-fixtures pass.

Closes #168,#139
  • Loading branch information
dignifiedquire authored Jan 9, 2023
1 parent d7ac11d commit 36188d5
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 131 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ libipld-json = { version = "0.15.0", path = "dag-json", optional = true }
libipld-macro = { version = "0.15.0", path = "macro" }
libipld-pb = { version = "0.15.0", path = "dag-pb", optional = true }
log = "0.4.14"
multihash = { version = "0.17.0", default-features = false, features = ["multihash-impl"] }
multihash = { version = "0.18.0", default-features = false, features = ["multihash-impl"] }
thiserror = "1.0.25"

[dev-dependencies]
async-std = { version = "1.9.0", features = ["attributes"] }
criterion = "0.3.4"
proptest = "1.0.0"
model = "0.1.2"
multihash = "0.17.0"
multihash = "0.18.0"

[features]
default = ["dag-cbor", "dag-json", "dag-pb", "derive"]
Expand Down
6 changes: 3 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ arb = ["quickcheck", "cid/arb"]

[dependencies]
anyhow = { version = "1.0.40", default-features = false }
cid = { version = "0.9.0", default-features = false, features = ["alloc"] }
cid = { version = "0.10.0", default-features = false, features = ["alloc"] }
core2 = { version = "0.4", default-features = false, features = ["alloc"] }
multihash = { version = "0.17.0", default-features = false, features = ["alloc"] }
multihash = { version = "0.18.0", default-features = false, features = ["alloc"] }

multibase = { version = "0.9.1", default-features = false, optional = true }
serde = { version = "1.0.132", default-features = false, features = ["alloc"], optional = true }
thiserror = {version = "1.0.25", optional = true }
quickcheck = { version = "1.0", optional = true }

[dev-dependencies]
multihash = { version = "0.17.0", default-features = false, features = ["multihash-impl", "blake3"] }
multihash = { version = "0.18.0", default-features = false, features = ["multihash-impl", "blake3"] }
serde_test = "1.0.132"
serde_bytes = "0.11.5"
serde_json = "1.0.79"
2 changes: 1 addition & 1 deletion dag-cbor/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn read_uint<R: Read>(r: &mut R, major: Major) -> Result<u64> {
0..=MAX_2BYTE => Err(NumberNotMinimal.into()),
value => Ok(value),
},
27 => match read_u64(r)? as u64 {
27 => match read_u64(r)? {
0..=MAX_4BYTE => Err(NumberNotMinimal.into()),
value => Ok(value),
},
Expand Down
2 changes: 1 addition & 1 deletion dag-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ repository = "https://github.com/ipfs-rust/rust-ipld"

[dependencies]
libipld-core = { version = "0.15.0", path = "../core" }
multihash = "0.17.0"
multihash = "0.18.0"
serde_json = { version = "1.0.64", features = ["float_roundtrip"] }
serde = { version = "1.0.126", features = ["derive"] }
7 changes: 5 additions & 2 deletions dag-pb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ repository = "https://github.com/ipfs-rust/rust-ipld"

[dependencies]
libipld-core = { version = "0.15.0", path = "../core" }
prost = "0.11.0"
thiserror = "1.0.25"
quick-protobuf = "0.8.1"
bytes = "1.3.0"

[dev-dependencies]
libipld-macro = { path = "../macro" }
multihash = "0.17.0"
libipld = { path = "../" }
multihash = "0.18.0"
hex = "0.4.3"
Loading

0 comments on commit 36188d5

Please sign in to comment.