Fix Eligere executeLawAmendment to always create Federal-level laws

Constitutional rights (RightLife, RightLiberty, etc.) are immutable in Lex
code and cannot be amended. Constitutional proposals still require 67%
supermajority but create Federal-level laws since Lex.RatifyAmendmentInternal
correctly panics when given LawCategoryConstitutional.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Tutus Development 2025-12-20 06:35:00 +00:00
parent 30b3be30ce
commit 9f97b39617
1 changed files with 3 additions and 7 deletions

View File

@ -865,16 +865,12 @@ func (e *Eligere) executeLawAmendment(ic *interop.Context, proposal *state.Propo
// The Lex contract's ratifyAmendment method will be called
// This creates or updates a law based on the proposal
if e.Lex != nil {
// Determine law category based on proposal category
// All amendments create Federal-level laws
// Constitutional rights (RightLife, RightLiberty, etc.) are immutable in code
// Constitutional proposals require 67% supermajority but still create Federal laws
lawCategory := state.LawCategoryFederal
if proposal.Category == state.ProposalCategoryConstitutional {
// Note: Constitutional rights are immutable in Lex
// This would create a constitutional-level law, not modify core rights
lawCategory = state.LawCategoryConstitutional
}
// Call Lex to ratify the amendment
// The Lex contract needs to have ratifyAmendment method added
e.Lex.RatifyAmendmentInternal(ic, proposal.ID, proposal.ContentHash, lawCategory, 0)
}
}