diff --git a/Cargo.lock b/Cargo.lock index 6819499..5146a45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/grin b/grin index d5f3235..e42e0c4 160000 --- a/grin +++ b/grin @@ -1 +1 @@ -Subproject commit d5f32350ab548736c17c1db7ff51457917fe4e96 +Subproject commit e42e0c4a9ead332545fc91fca21df2c99ada4e9e diff --git a/libwallet/src/contract/actions/README.md b/libwallet/src/contract/actions/README.md index 0deffb3..29d1b58 100644 --- a/libwallet/src/contract/actions/README.md +++ b/libwallet/src/contract/actions/README.md @@ -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. diff --git a/libwallet/src/slate_versions/mod.rs b/libwallet/src/slate_versions/mod.rs index fc2f4e1..8d3d099 100644 --- a/libwallet/src/slate_versions/mod.rs +++ b/libwallet/src/slate_versions/mod.rs @@ -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;