From b60fa298f805a2c3618d242ad8a804690fee9643 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:14:10 +0100 Subject: [PATCH] feat: add llmq_single_node quorum type (111) (#24) * feat: add llmq_single_node 111 quorum type * test: update llmq type validate test --- btcjson/dashevocmds.go | 4 +++- btcjson/dashevocmds_test.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/btcjson/dashevocmds.go b/btcjson/dashevocmds.go index 71e08d342a..8b376acf0c 100644 --- a/btcjson/dashevocmds.go +++ b/btcjson/dashevocmds.go @@ -140,6 +140,7 @@ const ( LLMQType_DEVNET_DIP0024 LLMQType = 105 // 8 members, 4 (50%) threshold, one per hour LLMQType_TEST_PLATFORM LLMQType = 106 // 3 members, 2 (66%) threshold, one per hour LLMQType_DEVNET_PLATFORM LLMQType = 107 // 12 members, 8 (67%) threshold, one per hour + LLMQType_SINGLE_NODE LLMQType = 111 // 1 memeber, 1 threshold, one per hour. // LLMQType_5_60 is replaced with LLMQType_TEST to adhere to DIP-0006 naming LLMQType_5_60 LLMQType = LLMQType_TEST @@ -164,6 +165,7 @@ var ( "llmq_devnet_dip0024": LLMQType_DEVNET_DIP0024, "llmq_test_platform": LLMQType_TEST_PLATFORM, "llmq_devnet_platform": LLMQType_DEVNET_PLATFORM, + "llmq_single_node": LLMQType_SINGLE_NODE, } ) @@ -189,7 +191,7 @@ func (t LLMQType) Name() string { // defined in accordance with DIP-0006. // See https://github.com/dashpay/dips/blob/master/dip-0006/llmq-types.md func (t LLMQType) Validate() error { - if (t >= LLMQType_50_60 && t <= LLMQType_25_67) || (t >= LLMQType_TEST && t <= LLMQType_DEVNET_PLATFORM) { + if (t >= LLMQType_50_60 && t <= LLMQType_25_67) || (t >= LLMQType_TEST && t <= LLMQType_DEVNET_PLATFORM) || t == LLMQType_SINGLE_NODE { return nil } diff --git a/btcjson/dashevocmds_test.go b/btcjson/dashevocmds_test.go index 5588fbf836..bcae65a9a9 100644 --- a/btcjson/dashevocmds_test.go +++ b/btcjson/dashevocmds_test.go @@ -221,6 +221,9 @@ func TestLLMQTypeValidate(t *testing.T) { {106, false}, {107, false}, {108, true}, + {110, true}, + {111, false}, + {112, true}, } for _, tc := range testCases {