tutus-chain/pkg/core/native/native_test
Tutus Development a18363ce0b Add Annos lifespan contract and Eligere voting age integration
Implement the Annos (Latin for "years") contract for tracking citizen
lifespan and age-based entitlements:

Annos Contract (pkg/core/native/annos.go):
- LifespanRecord tracks birth/death timestamps per Vita holder
- Age calculation from birthTimestamp (provided during registration)
- Life stages: Child (0-17), Youth (18-25), Adult (26-64), Elder (65+)
- Entitlement checks: isVotingAge, isAdult, isRetirementAge, isAlive
- recordDeath method (committee only) for mortality tracking
- Cross-contract methods for internal use by other contracts

State Types (pkg/core/state/annos.go):
- LifeStage, LifespanStatus enums
- LifespanRecord, AnnosConfig structs with serialization

Vita Integration:
- Updated register() to accept birthTimestamp parameter
- birthTimestamp is the actual birth date, NOT the mint date
- Calls Annos.RegisterBirthInternal() after minting Vita
- Enables existing adults to register with their real birth date

Eligere Integration:
- Added Annos IAnnos field to Eligere struct
- Added voting age check in vote() method
- Voters must be 18+ (configurable via AnnosConfig.VotingAge)
- New ErrUnderVotingAge error for underage voters

Contract Wiring:
- Added eligere.Annos = annos in NewDefaultContracts()
- Contract ID: -26 (next after Collocatio)

Tests (pkg/core/native/native_test/annos_test.go):
- 17 comprehensive tests covering all Annos functionality
- Age-based tests for Child, Youth, Adult life stages
- Note: Elder test skipped (uint64 can't represent pre-1970 dates)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:55:29 +00:00
..
helpers/policyhelper Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
annos_test.go Add Annos lifespan contract and Eligere voting age integration 2025-12-21 00:55:29 +00:00
common_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
cryptolib_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
cryptolib_verification_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
designate_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
eligere_test.go Add Eligere native contract tests 2025-12-20 06:44:00 +00:00
gas_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
ledger_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
management_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
neo_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
notary_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
opus_test.go Add Opus native contract for AI workforce integration 2025-12-20 08:51:48 +00:00
oracle_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
policy_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
role_registry_test.go Add RoleRegistry native contract for hierarchical RBAC 2025-12-20 01:35:26 +00:00
salus_test.go Add Salus native contract for universal healthcare 2025-12-20 08:53:57 +00:00
scire_test.go Add Scire native contract for universal education 2025-12-20 07:25:08 +00:00
sese_test.go Add Sese native contract for life planning 2025-12-20 08:54:28 +00:00
std_test.go Update all imports from neo-go to tutus-chain 2025-12-19 14:28:17 +00:00
treasury_test.go Rename NEO to Annos and GAS to Lub native contracts 2025-12-20 11:34:42 +00:00
tribute_test.go Add Tribute native contract for anti-hoarding economics 2025-12-20 08:53:19 +00:00
vita_test.go Add Eligere native contract for democratic voting 2025-12-20 06:30:43 +00:00
vts_test.go Add Eligere native contract for democratic voting 2025-12-20 06:30:43 +00:00