Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bounties/issue-2310/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
__version__ = '1.0.0'
__author__ = 'RustChain Bounty Program'

from crt_pattern_generator import CRTPatternGenerator
from crt_capture import CRTCapture, CaptureConfig, CaptureMethod
from crt_analyzer import CRTAnalyzer, CRTFingerprint
from crt_attestation_submitter import CRTAttestationSubmitter, CRTAttestation
from .crt_pattern_generator import CRTPatternGenerator
from .crt_capture import CRTCapture, CaptureConfig, CaptureMethod
from .crt_analyzer import CRTAnalyzer, CRTFingerprint
from .crt_attestation_submitter import CRTAttestationSubmitter, CRTAttestation

__all__ = [
'CRTPatternGenerator',
Expand Down
20 changes: 10 additions & 10 deletions bounties/issue-2310/validate_bounty_2310.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def print_header(text):
print(f"{BLUE}{'=' * 60}{RESET}\n")

def print_success(text):
print(f"{GREEN} {text}{RESET}")
print(f"{GREEN}[PASS] {text}{RESET}")

def print_error(text):
print(f"{RED} {text}{RESET}")
print(f"{RED}[FAIL] {text}{RESET}")

def print_info(text):
print(f"{YELLOW}ℹ️ {text}{RESET}")
print(f"{YELLOW}[INFO] {text}{RESET}")

def check_file_exists(filepath, description):
"""Check if a file exists"""
Expand All @@ -48,7 +48,7 @@ def check_file_content(filepath, patterns, description):
print_error(f"{description} missing: {filepath}")
return False

with open(filepath, 'r') as f:
with open(filepath, 'r', encoding='utf-8') as f:
content = f.read()

all_found = True
Expand All @@ -66,7 +66,7 @@ def count_lines(filepath):
"""Count lines in a file"""
if not os.path.exists(filepath):
return 0
with open(filepath, 'r') as f:
with open(filepath, 'r', encoding='utf-8') as f:
return sum(1 for _ in f)

def get_file_hash(filepath):
Expand Down Expand Up @@ -242,7 +242,7 @@ def validate_tests():
'pytest'
]

with open(test_file, 'r') as f:
with open(test_file, 'r', encoding='utf-8') as f:
content = f.read()

all_valid = True
Expand Down Expand Up @@ -271,7 +271,7 @@ def validate_evidence():
print_error("Evidence file missing: proof.json")
return False

with open(proof_file, 'r') as f:
with open(proof_file, 'r', encoding='utf-8') as f:
proof = json.load(f)

required_fields = [
Expand Down Expand Up @@ -306,7 +306,7 @@ def validate_requirements():
base_dir = Path(__file__).parent / 'evidence'
proof_file = base_dir / 'proof.json'

with open(proof_file, 'r') as f:
with open(proof_file, 'r', encoding='utf-8') as f:
proof = json.load(f)

req_verify = proof.get('requirements_verification', {})
Expand Down Expand Up @@ -404,10 +404,10 @@ def main():
print(f" Total source lines: {total_lines}")

if passed == total:
print(f"\n{GREEN} VALIDATION PASSED - Implementation is complete!{RESET}\n")
print(f"\n{GREEN}[PASS] VALIDATION PASSED - Implementation is complete!{RESET}\n")
return 0
else:
print(f"\n{RED} VALIDATION FAILED - {total - passed} checks failed{RESET}\n")
print(f"\n{RED}[FAIL] VALIDATION FAILED - {total - passed} checks failed{RESET}\n")
return 1

if __name__ == '__main__':
Expand Down