v0.0.4 - nip09 implemented
This commit is contained in:
@@ -99,6 +99,47 @@ publish_event() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to publish invalid event and expect rejection
|
||||
publish_invalid_event() {
|
||||
local event_json="$1"
|
||||
local description="$2"
|
||||
local expected_error="$3"
|
||||
|
||||
print_info "Publishing invalid $description..."
|
||||
|
||||
# Create EVENT message in Nostr format
|
||||
local event_message="[\"EVENT\",$event_json]"
|
||||
|
||||
# Publish to relay
|
||||
local response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
response=$(echo "$event_message" | timeout 5s websocat "$RELAY_URL" 2>&1 || echo "Connection failed")
|
||||
else
|
||||
print_error "websocat not found - required for testing"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check response - should contain "false" and error message
|
||||
if [[ "$response" == *"Connection failed"* ]]; then
|
||||
print_error "Failed to connect to relay for $description"
|
||||
return 1
|
||||
elif [[ "$response" == *"false"* ]]; then
|
||||
# Extract error message
|
||||
local error_msg=$(echo "$response" | grep -o '"[^"]*invalid[^"]*"' | head -1 | sed 's/"//g' 2>/dev/null || echo "rejected")
|
||||
print_success "$description correctly rejected: $error_msg"
|
||||
echo # Add blank line for readability
|
||||
return 0
|
||||
elif [[ "$response" == *"true"* ]]; then
|
||||
print_error "$description was incorrectly accepted (should have been rejected)"
|
||||
echo # Add blank line for readability
|
||||
return 1
|
||||
else
|
||||
print_warning "$description response unclear: $response"
|
||||
echo # Add blank line for readability
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Test subscription with filters
|
||||
test_subscription() {
|
||||
local sub_id="$1"
|
||||
@@ -211,7 +252,41 @@ run_comprehensive_test() {
|
||||
# Brief pause to let events settle
|
||||
sleep 2
|
||||
|
||||
print_header "PHASE 2: Testing Subscriptions and Filters"
|
||||
print_header "PHASE 2: Testing Invalid Events (NIP-01 Validation)"
|
||||
|
||||
print_step "Testing various invalid events that should be rejected..."
|
||||
|
||||
# Test 1: Event with invalid JSON structure (malformed)
|
||||
local malformed_event='{"id":"invalid","pubkey":"invalid_pubkey","created_at":"not_a_number","kind":1,"tags":[],"content":"test"}'
|
||||
publish_invalid_event "$malformed_event" "malformed event with invalid created_at" "invalid"
|
||||
|
||||
# Test 2: Event with missing required fields
|
||||
local missing_field_event='{"id":"test123","pubkey":"valid_pubkey","kind":1,"tags":[],"content":"test"}'
|
||||
publish_invalid_event "$missing_field_event" "event missing created_at and sig" "invalid"
|
||||
|
||||
# Test 3: Event with invalid pubkey format (not hex)
|
||||
local invalid_pubkey_event='{"id":"abc123","pubkey":"not_valid_hex_pubkey","created_at":1234567890,"kind":1,"tags":[],"content":"test","sig":"fake_sig"}'
|
||||
publish_invalid_event "$invalid_pubkey_event" "event with invalid pubkey format" "invalid"
|
||||
|
||||
# Test 4: Event with invalid event ID format
|
||||
local invalid_id_event='{"id":"not_64_char_hex","pubkey":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","created_at":1234567890,"kind":1,"tags":[],"content":"test","sig":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}'
|
||||
publish_invalid_event "$invalid_id_event" "event with invalid ID format" "invalid"
|
||||
|
||||
# Test 5: Event with invalid signature
|
||||
local invalid_sig_event='{"id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","pubkey":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","created_at":1234567890,"kind":1,"tags":[],"content":"test","sig":"invalid_signature_format"}'
|
||||
publish_invalid_event "$invalid_sig_event" "event with invalid signature format" "invalid"
|
||||
|
||||
# Test 6: Event with invalid kind (negative)
|
||||
local invalid_kind_event='{"id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","pubkey":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","created_at":1234567890,"kind":-1,"tags":[],"content":"test","sig":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}'
|
||||
publish_invalid_event "$invalid_kind_event" "event with negative kind" "invalid"
|
||||
|
||||
# Test 7: Event with invalid tags format (not array)
|
||||
local invalid_tags_event='{"id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","pubkey":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","created_at":1234567890,"kind":1,"tags":"not_an_array","content":"test","sig":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}'
|
||||
publish_invalid_event "$invalid_tags_event" "event with invalid tags format" "invalid"
|
||||
|
||||
print_success "Invalid event tests completed - all should have been rejected"
|
||||
|
||||
print_header "PHASE 3: Testing Subscriptions and Filters"
|
||||
|
||||
# Test subscription filters
|
||||
print_step "Testing various subscription filters..."
|
||||
@@ -240,7 +315,7 @@ run_comprehensive_test() {
|
||||
# Test 7: Limit results
|
||||
test_subscription "test_limit" '{"kinds":[1],"limit":1}' "Limited to 1 event" "1"
|
||||
|
||||
print_header "PHASE 3: Database Verification"
|
||||
print_header "PHASE 4: Database Verification"
|
||||
|
||||
# Check what's actually stored in the database
|
||||
print_step "Verifying database contents..."
|
||||
@@ -265,13 +340,14 @@ run_comprehensive_test() {
|
||||
}
|
||||
|
||||
# Run the comprehensive test
|
||||
print_header "Starting C-Relay Comprehensive Test Suite"
|
||||
print_header "Starting C-Relay Comprehensive Test Suite with NIP-01 Validation"
|
||||
echo
|
||||
|
||||
if run_comprehensive_test; then
|
||||
echo
|
||||
print_success "All tests completed successfully!"
|
||||
print_info "The C-Relay hybrid schema implementation is working correctly"
|
||||
print_info "The C-Relay with full NIP-01 validation is working correctly"
|
||||
print_info "✅ Event validation, signature verification, and error handling all working"
|
||||
echo
|
||||
exit 0
|
||||
else
|
||||
|
||||
386
tests/9_delete_test.sh
Executable file
386
tests/9_delete_test.sh
Executable file
@@ -0,0 +1,386 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NIP-09 Event Deletion Request Test for C-Relay
|
||||
# Tests deletion request functionality - assumes relay is already running
|
||||
# Based on the pattern from 1_nip_test.sh
|
||||
|
||||
set -e
|
||||
|
||||
# Color constants
|
||||
RED='\033[31m'
|
||||
GREEN='\033[32m'
|
||||
YELLOW='\033[33m'
|
||||
BLUE='\033[34m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# Test configuration
|
||||
RELAY_URL="ws://127.0.0.1:8888"
|
||||
TEST_PRIVATE_KEY="nsec1j4c6269y9w0q2er2xjw8sv2ehyrtfxq3jwgdlxj6qfn8z4gjsq5qfvfk99"
|
||||
|
||||
# Print functions
|
||||
print_header() {
|
||||
echo -e "${BLUE}${BOLD}=== $1 ===${RESET}"
|
||||
}
|
||||
|
||||
print_step() {
|
||||
echo -e "${YELLOW}[STEP]${RESET} $1"
|
||||
}
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}✓${RESET} $1"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}✗${RESET} $1"
|
||||
}
|
||||
|
||||
print_info() {
|
||||
echo -e "${BLUE}[INFO]${RESET} $1"
|
||||
}
|
||||
|
||||
print_warning() {
|
||||
echo -e "${YELLOW}[WARNING]${RESET} $1"
|
||||
}
|
||||
|
||||
# Helper function to publish event and extract ID
|
||||
publish_event() {
|
||||
local event_json="$1"
|
||||
local description="$2"
|
||||
|
||||
# Extract event ID
|
||||
local event_id=$(echo "$event_json" | jq -r '.id' 2>/dev/null)
|
||||
if [[ "$event_id" == "null" || -z "$event_id" ]]; then
|
||||
print_error "Could not extract event ID from $description"
|
||||
return 1
|
||||
fi
|
||||
|
||||
print_info "Publishing $description..."
|
||||
|
||||
# Create EVENT message in Nostr format
|
||||
local event_message="[\"EVENT\",$event_json]"
|
||||
|
||||
# Publish to relay
|
||||
local response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
response=$(echo "$event_message" | timeout 5s websocat "$RELAY_URL" 2>&1 || echo "Connection failed")
|
||||
else
|
||||
print_error "websocat not found - required for testing"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check response
|
||||
if [[ "$response" == *"Connection failed"* ]]; then
|
||||
print_error "Failed to connect to relay for $description"
|
||||
return 1
|
||||
elif [[ "$response" == *"true"* ]]; then
|
||||
print_success "$description uploaded (ID: ${event_id:0:16}...)"
|
||||
echo "$event_id"
|
||||
return 0
|
||||
else
|
||||
print_warning "$description might have failed: $response"
|
||||
echo ""
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to publish deletion request
|
||||
publish_deletion_request() {
|
||||
local deletion_event_json="$1"
|
||||
local description="$2"
|
||||
|
||||
# Extract event ID
|
||||
local event_id=$(echo "$deletion_event_json" | jq -r '.id' 2>/dev/null)
|
||||
if [[ "$event_id" == "null" || -z "$event_id" ]]; then
|
||||
print_error "Could not extract event ID from $description"
|
||||
return 1
|
||||
fi
|
||||
|
||||
print_info "Publishing $description..."
|
||||
|
||||
# Create EVENT message in Nostr format
|
||||
local event_message="[\"EVENT\",$deletion_event_json]"
|
||||
|
||||
# Publish to relay
|
||||
local response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
response=$(echo "$event_message" | timeout 5s websocat "$RELAY_URL" 2>&1 || echo "Connection failed")
|
||||
else
|
||||
print_error "websocat not found - required for testing"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check response
|
||||
if [[ "$response" == *"Connection failed"* ]]; then
|
||||
print_error "Failed to connect to relay for $description"
|
||||
return 1
|
||||
elif [[ "$response" == *"true"* ]]; then
|
||||
print_success "$description accepted (ID: ${event_id:0:16}...)"
|
||||
echo "$event_id"
|
||||
return 0
|
||||
else
|
||||
print_warning "$description might have failed: $response"
|
||||
echo ""
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper function to check if event exists via subscription
|
||||
check_event_exists() {
|
||||
local event_id="$1"
|
||||
local sub_id="exists_$(date +%s%N | cut -c1-10)"
|
||||
|
||||
# Create REQ message to query for specific event ID
|
||||
local req_message="[\"REQ\",\"$sub_id\",{\"ids\":[\"$event_id\"]}]"
|
||||
|
||||
# Send subscription and collect events
|
||||
local response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
response=$(echo -e "$req_message\n[\"CLOSE\",\"$sub_id\"]" | timeout 3s websocat "$RELAY_URL" 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
# Count EVENT responses
|
||||
local event_count=0
|
||||
if [[ -n "$response" ]]; then
|
||||
event_count=$(echo "$response" | grep -c "\"EVENT\"" 2>/dev/null || echo "0")
|
||||
fi
|
||||
|
||||
echo "$event_count"
|
||||
}
|
||||
|
||||
# Helper function to query events by kind
|
||||
query_events_by_kind() {
|
||||
local kind="$1"
|
||||
local sub_id="kind${kind}_$(date +%s%N | cut -c1-10)"
|
||||
|
||||
# Create REQ message to query for events of specific kind
|
||||
local req_message="[\"REQ\",\"$sub_id\",{\"kinds\":[$kind]}]"
|
||||
|
||||
# Send subscription and collect events
|
||||
local response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
response=$(echo -e "$req_message\n[\"CLOSE\",\"$sub_id\"]" | timeout 3s websocat "$RELAY_URL" 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
# Count EVENT responses
|
||||
local event_count=0
|
||||
if [[ -n "$response" ]]; then
|
||||
event_count=$(echo "$response" | grep -c "\"EVENT\"" 2>/dev/null || echo "0")
|
||||
fi
|
||||
|
||||
echo "$event_count"
|
||||
}
|
||||
|
||||
# Main test function
|
||||
run_deletion_test() {
|
||||
print_header "NIP-09 Event Deletion Request Test"
|
||||
|
||||
# Check dependencies
|
||||
print_step "Checking dependencies..."
|
||||
if ! command -v nak &> /dev/null; then
|
||||
print_error "nak command not found"
|
||||
print_info "Please install nak: go install github.com/fiatjaf/nak@latest"
|
||||
return 1
|
||||
fi
|
||||
if ! command -v websocat &> /dev/null; then
|
||||
print_error "websocat command not found"
|
||||
print_info "Please install websocat for testing"
|
||||
return 1
|
||||
fi
|
||||
if ! command -v jq &> /dev/null; then
|
||||
print_error "jq command not found"
|
||||
print_info "Please install jq for JSON processing"
|
||||
return 1
|
||||
fi
|
||||
print_success "All dependencies found"
|
||||
|
||||
print_header "PHASE 1: Publishing Events to be Deleted"
|
||||
|
||||
# Create test events that will be deleted
|
||||
print_step "Creating events for deletion testing..."
|
||||
|
||||
# Create regular events (kind 1) - these will be deleted by ID
|
||||
local event1=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Event to be deleted #1" -k 1 --ts $(($(date +%s) - 100)) -t "type=test" -t "phase=deletion" 2>/dev/null)
|
||||
local event2=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Event to be deleted #2" -k 1 --ts $(($(date +%s) - 90)) -t "type=test" -t "phase=deletion" 2>/dev/null)
|
||||
|
||||
# Publish the events
|
||||
event1_id=$(publish_event "$event1" "Event to be deleted #1")
|
||||
if [[ -z "$event1_id" ]]; then
|
||||
print_error "Failed to publish test event #1"
|
||||
return 1
|
||||
fi
|
||||
|
||||
event2_id=$(publish_event "$event2" "Event to be deleted #2")
|
||||
if [[ -z "$event2_id" ]]; then
|
||||
print_error "Failed to publish test event #2"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Create an addressable event (kind 30001) - will be deleted by address
|
||||
local addr_event=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Addressable event to be deleted" -k 30001 --ts $(($(date +%s) - 80)) -t "d=test-delete" -t "type=addressable" 2>/dev/null)
|
||||
|
||||
addr_event_id=$(publish_event "$addr_event" "Addressable event to be deleted")
|
||||
if [[ -z "$addr_event_id" ]]; then
|
||||
print_error "Failed to publish addressable test event"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Create an event by a different author (to test unauthorized deletion)
|
||||
local different_key="nsec1234567890abcdef1234567890abcdef1234567890abcdef1234567890ab"
|
||||
local unauth_event=$(nak event --sec "$different_key" -c "Event by different author" -k 1 --ts $(($(date +%s) - 70)) -t "type=unauthorized" 2>/dev/null)
|
||||
|
||||
unauth_event_id=$(publish_event "$unauth_event" "Event by different author")
|
||||
if [[ -z "$unauth_event_id" ]]; then
|
||||
print_warning "Failed to publish unauthorized test event - continuing anyway"
|
||||
fi
|
||||
|
||||
# Let events settle
|
||||
sleep 2
|
||||
|
||||
print_header "PHASE 2: Testing Event Deletion by ID"
|
||||
|
||||
print_step "Verifying events exist before deletion..."
|
||||
local event1_before=$(check_event_exists "$event1_id")
|
||||
local event2_before=$(check_event_exists "$event2_id")
|
||||
print_info "Event1 exists: $event1_before, Event2 exists: $event2_before"
|
||||
|
||||
# Create deletion request targeting the two events by ID
|
||||
print_step "Creating deletion request for events by ID..."
|
||||
local deletion_by_id=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Deleting events by ID" -k 5 --ts $(date +%s) -e "$event1_id" -e "$event2_id" -t "k=1" 2>/dev/null)
|
||||
|
||||
deletion_id=$(publish_deletion_request "$deletion_by_id" "Deletion request for events by ID")
|
||||
if [[ -z "$deletion_id" ]]; then
|
||||
print_error "Failed to publish deletion request"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Wait for deletion to process
|
||||
sleep 3
|
||||
|
||||
# Check if events were deleted
|
||||
print_step "Verifying events were deleted..."
|
||||
local event1_after=$(check_event_exists "$event1_id")
|
||||
local event2_after=$(check_event_exists "$event2_id")
|
||||
print_info "Event1 exists after deletion: $event1_after, Event2 exists after deletion: $event2_after"
|
||||
|
||||
if [[ "$event1_after" == "0" && "$event2_after" == "0" ]]; then
|
||||
print_success "✓ Events successfully deleted by ID"
|
||||
else
|
||||
print_error "✗ Events were not properly deleted"
|
||||
fi
|
||||
|
||||
print_header "PHASE 3: Testing Address-based Deletion"
|
||||
|
||||
if [[ -n "$addr_event_id" ]]; then
|
||||
print_step "Verifying addressable event exists before deletion..."
|
||||
local addr_before=$(check_event_exists "$addr_event_id")
|
||||
print_info "Addressable event exists: $addr_before"
|
||||
|
||||
# Create deletion request for addressable event using 'a' tag
|
||||
print_step "Creating deletion request for addressable event..."
|
||||
local test_pubkey=$(echo "$addr_event" | jq -r '.pubkey' 2>/dev/null)
|
||||
local deletion_by_addr=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Deleting addressable event" -k 5 --ts $(date +%s) -t "a=30001:${test_pubkey}:test-delete" -t "k=30001" 2>/dev/null)
|
||||
|
||||
addr_deletion_id=$(publish_deletion_request "$deletion_by_addr" "Deletion request for addressable event")
|
||||
if [[ -n "$addr_deletion_id" ]]; then
|
||||
# Wait for deletion to process
|
||||
sleep 3
|
||||
|
||||
# Check if addressable event was deleted
|
||||
print_step "Verifying addressable event was deleted..."
|
||||
local addr_after=$(check_event_exists "$addr_event_id")
|
||||
print_info "Addressable event exists after deletion: $addr_after"
|
||||
|
||||
if [[ "$addr_after" == "0" ]]; then
|
||||
print_success "✓ Addressable event successfully deleted"
|
||||
else
|
||||
print_error "✗ Addressable event was not properly deleted"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
print_header "PHASE 4: Testing Unauthorized Deletion"
|
||||
|
||||
if [[ -n "$unauth_event_id" ]]; then
|
||||
print_step "Testing unauthorized deletion attempt..."
|
||||
|
||||
# Try to delete the unauthorized event (should fail)
|
||||
local unauth_deletion=$(nak event --sec "$TEST_PRIVATE_KEY" -c "Attempting unauthorized deletion" -k 5 --ts $(date +%s) -e "$unauth_event_id" -t "k=1" 2>/dev/null)
|
||||
|
||||
unauth_deletion_id=$(publish_deletion_request "$unauth_deletion" "Unauthorized deletion request")
|
||||
if [[ -n "$unauth_deletion_id" ]]; then
|
||||
# Wait for processing
|
||||
sleep 3
|
||||
|
||||
# Check if unauthorized event still exists (should still exist)
|
||||
local unauth_after=$(check_event_exists "$unauth_event_id")
|
||||
print_info "Unauthorized event exists after deletion attempt: $unauth_after"
|
||||
|
||||
if [[ "$unauth_after" == "1" ]]; then
|
||||
print_success "✓ Unauthorized deletion properly rejected - event still exists"
|
||||
else
|
||||
print_error "✗ Unauthorized deletion succeeded - security vulnerability!"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
print_header "PHASE 5: Testing Invalid Deletion Requests"
|
||||
|
||||
print_step "Testing deletion request with no targets..."
|
||||
|
||||
# Create deletion request with no 'e' or 'a' tags (should be rejected)
|
||||
local invalid_deletion='{"id":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef","pubkey":"aa4fc8665f5696e33db7e1a572e3b0f5b3d615837b0f362dcb1c8068b098c7b4","created_at":'$(date +%s)',"kind":5,"tags":[["k","1"]],"content":"Invalid deletion request with no targets","sig":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}'
|
||||
|
||||
# Create EVENT message in Nostr format
|
||||
local invalid_message="[\"EVENT\",$invalid_deletion]"
|
||||
|
||||
# Publish to relay
|
||||
local invalid_response=""
|
||||
if command -v websocat &> /dev/null; then
|
||||
invalid_response=$(echo "$invalid_message" | timeout 5s websocat "$RELAY_URL" 2>&1 || echo "Connection failed")
|
||||
fi
|
||||
|
||||
# Check response - should be rejected
|
||||
if [[ "$invalid_response" == *"false"* ]]; then
|
||||
print_success "✓ Invalid deletion request properly rejected"
|
||||
elif [[ "$invalid_response" == *"true"* ]]; then
|
||||
print_warning "⚠ Invalid deletion request was accepted (should have been rejected)"
|
||||
else
|
||||
print_info "Invalid deletion request response: $invalid_response"
|
||||
fi
|
||||
|
||||
print_header "PHASE 6: Verification"
|
||||
|
||||
# Verify deletion requests themselves are stored
|
||||
print_step "Verifying deletion requests are stored..."
|
||||
local deletion_count=$(query_events_by_kind 5)
|
||||
print_info "Deletion requests accessible via query: $deletion_count"
|
||||
|
||||
if [[ "$deletion_count" -gt 0 ]]; then
|
||||
print_success "✓ Deletion requests properly stored and queryable"
|
||||
else
|
||||
print_warning "⚠ No deletion requests found via query"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Run the test
|
||||
print_header "Starting NIP-09 Event Deletion Request Test Suite"
|
||||
echo
|
||||
|
||||
if run_deletion_test; then
|
||||
echo
|
||||
print_success "All NIP-09 deletion tests completed successfully!"
|
||||
print_info "The C-Relay NIP-09 implementation is working correctly"
|
||||
print_info "✅ Event deletion by ID working"
|
||||
print_info "✅ Address-based deletion working"
|
||||
print_info "✅ Authorization validation working"
|
||||
print_info "✅ Invalid deletion rejection working"
|
||||
echo
|
||||
exit 0
|
||||
else
|
||||
echo
|
||||
print_error "Some NIP-09 tests failed"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user