From d4a2d3537282c455715de34fd98f2635e0fbf4d7 Mon Sep 17 00:00:00 2001 From: stringintech Date: Tue, 9 Dec 2025 18:06:57 +0330 Subject: [PATCH] Remove ScriptVerifyStatus type and constants Use C API constants directly instead of wrapping them in Go types. The status codes were only used internally for error checking and never exposed in the public API. --- kernel/script_pubkey.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/kernel/script_pubkey.go b/kernel/script_pubkey.go index 0e1beae..c77b354 100644 --- a/kernel/script_pubkey.go +++ b/kernel/script_pubkey.go @@ -125,13 +125,11 @@ func (s *scriptPubkeyApi) Verify(amount int64, txTo *Transaction, spentOutputs [ &cStatus, ) - status := ScriptVerifyStatus(cStatus) - // Check for errors that prevented verification - if status == ScriptVerifyErrorInvalidFlagsCombination { + if cStatus == C.btck_ScriptVerifyStatus_ERROR_INVALID_FLAGS_COMBINATION { return false, ErrVerifyScriptVerifyInvalidFlagsCombination } - if status == ScriptVerifyErrorSpentOutputsRequired { + if cStatus == C.btck_ScriptVerifyStatus_ERROR_SPENT_OUTPUTS_REQUIRED { return false, ErrVerifyScriptVerifySpentOutputsRequired } @@ -155,12 +153,3 @@ const ( ScriptFlagsVerifyTaproot ScriptFlags = C.btck_ScriptVerificationFlags_TAPROOT // Enable TAPROOT (BIPs 341 & 342) ScriptFlagsVerifyAll ScriptFlags = C.btck_ScriptVerificationFlags_ALL // All verification flags combined ) - -// ScriptVerifyStatus represents a collection of status codes that may be issued by the script verify function. -type ScriptVerifyStatus C.btck_ScriptVerifyStatus - -const ( - ScriptVerifyOK ScriptVerifyStatus = C.btck_ScriptVerifyStatus_OK // Script verification succeeded - ScriptVerifyErrorInvalidFlagsCombination ScriptVerifyStatus = C.btck_ScriptVerifyStatus_ERROR_INVALID_FLAGS_COMBINATION // The verification flags were combined in an invalid way - ScriptVerifyErrorSpentOutputsRequired ScriptVerifyStatus = C.btck_ScriptVerifyStatus_ERROR_SPENT_OUTPUTS_REQUIRED // The taproot flag was set, so valid spent outputs must be provided -)