ruleconfig

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ruleconfig provides strict format validation for rule configuration only. Used by API (create/update rule), config load (rule_init), and validate-rules CLI. For request/query/enum validation (address, sign_type, mode, chain_type, etc.) use internal/validate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateJSRuleTestCasesRequirement

func ValidateJSRuleTestCasesRequirement(positiveCount, negativeCount int) error

ValidateJSRuleTestCasesRequirement enforces the same rule as Solidity: at least one positive and one negative test case. Call when validating evm_js rules that have test_cases. positiveCount and negativeCount are the number of test cases with expect_pass true/false.

func ValidateRuleConfig

func ValidateRuleConfig(ruleType string, config map[string]interface{}) error

ValidateRuleConfig validates config map for the given rule type. Returns an error if format is wrong (e.g. allowed_sign_types as string instead of array, or sign_type_filter with invalid tokens). Call this before persisting rules from API or config.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL