Skip to content

Commit ba366fd

Browse files
committed
Add a feature for serde deny unknown fields
Currently there is no way to turn off the deny unknown fields attribute. This can cause issues when using the crate in cases where there are new fields added that are not yet in the types structs, e.g. in unmerged Core PRs. Add a feature to types that can be used to enable this attribute, which is off by default. Forward the feature to client and then to node. Use the feature in integration_test, through the node dependency.
1 parent 2406d12 commit ba366fd

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

integration_test/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,7 @@ bitcoin = { version = "0.32.0", default-features = false, features = ["std", "se
5959
env_logger = "0.9.0"
6060
node = { package = "corepc-node", path = "../node", default-features = false }
6161
rand = "0.8.5"
62+
# Just so we can enable the feature.
63+
types = { package = "corepc-types", path = "../types", features = ["serde-deny-unknown-fields"] }
6264

6365
[dev-dependencies]

types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ exclude = ["tests", "contrib"]
1515
[features]
1616
default = ["std"]
1717
std = ["bitcoin/std"]
18+
serde-deny-unknown-fields = []
1819

1920
[dependencies]
2021
bitcoin = { version = "0.32.0", default-features = false, features = ["serde", "base64", "secp-recovery"] }

0 commit comments

Comments
 (0)