use grin kernel feature constants

This commit is contained in:
wiesche
2026-09-15 22:54:29 +02:00
parent edb0660ea3
commit 585721abe6
4 changed files with 15 additions and 16 deletions
Generated
+8 -8
View File
@@ -2222,7 +2222,7 @@ checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d"
[[package]]
name = "grin_api"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"bytes 1.12.0",
"easy-jsonrpc-mw",
@@ -2254,7 +2254,7 @@ dependencies = [
[[package]]
name = "grin_chain"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"bit-vec",
"bitflags 1.3.2",
@@ -2278,7 +2278,7 @@ dependencies = [
[[package]]
name = "grin_core"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"blake2-rfc",
"byteorder",
@@ -2304,7 +2304,7 @@ dependencies = [
[[package]]
name = "grin_keychain"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"blake2-rfc",
"byteorder",
@@ -2325,7 +2325,7 @@ dependencies = [
[[package]]
name = "grin_p2p"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"bitflags 1.3.2",
"built",
@@ -2348,7 +2348,7 @@ dependencies = [
[[package]]
name = "grin_pool"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"blake2-rfc",
"chrono",
@@ -2380,7 +2380,7 @@ dependencies = [
[[package]]
name = "grin_store"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"byteorder",
"chrono",
@@ -2402,7 +2402,7 @@ dependencies = [
[[package]]
name = "grin_util"
version = "5.5.1"
version = "5.5.1-alpha.0"
dependencies = [
"anyhow",
"backtrace",
+1 -1
Submodule grin updated: d5f32350ab...e42e0c4a9e
-1
View File
@@ -43,7 +43,6 @@ without a user confirmation step.
races a transaction already in the mempool.
- Add a Grin node API for kernel lookup by MMR index, then use the witness index instead
of searching by commitment.
- Expose the kernel feature constants from `grin_core` and reuse them here.
- Add compact Slatepack support for contracts
- Keep Slate V5 experimental until the related RFCs are accepted
- Add contract history, lookup and transport.
+6 -6
View File
@@ -17,6 +17,7 @@
//! Versions earlier than V3 are removed for the 4.0.0 release, but versioning code
//! remains for future needs
use crate::grin_core::core::transaction::KernelFeatures;
use crate::slate::Slate;
use crate::slate_versions::v4::{CoinbaseV4, SlateV4};
use crate::slate_versions::v4_bin::SlateV4Bin;
@@ -44,11 +45,11 @@ pub const CURRENT_SLATE_VERSION: u16 = 5;
/// The latest grin block header version this wallet supports
pub const GRIN_BLOCK_HEADER_VERSION: u16 = 5;
const HEIGHT_LOCKED_FEATURE: u8 = 2;
const NRD_FEATURE: u8 = 3;
fn kernel_has_height_arg(feature: u8) -> bool {
matches!(feature, HEIGHT_LOCKED_FEATURE | NRD_FEATURE)
matches!(
feature,
KernelFeatures::HEIGHT_LOCKED_U8 | KernelFeatures::NO_RECENT_DUPLICATE_U8
)
}
/// Existing versions of the slate
@@ -185,7 +186,6 @@ impl VersionedCoinbase {
/// Shared slate fixtures, used by the version conversion tests
#[cfg(test)]
pub mod tests {
use super::HEIGHT_LOCKED_FEATURE;
use crate::grin_core::core::transaction::{KernelFeatures, NRDRelativeHeight, OutputFeatures};
use crate::grin_core::core::FeeFields;
use crate::grin_util::from_hex;
@@ -291,7 +291,7 @@ pub mod tests {
// basic fields
slate_internal.amount = 23820323;
slate_internal.kernel_features = HEIGHT_LOCKED_FEATURE;
slate_internal.kernel_features = KernelFeatures::HEIGHT_LOCKED_U8;
slate_internal.num_participants = 3;
slate_internal.fee_fields = FeeFields::new(0, 42)?;
slate_internal.ttl_cutoff_height = 100;