feat(gl): add standalone ledger authority mode
CI/CD Stage / stage (push) Failing after 1m12s

This commit is contained in:
2026-10-06 22:40:07 +03:30
parent 01d13dbbf2
commit 88e227f80c
26 changed files with 2033 additions and 196 deletions
+36
View File
@@ -0,0 +1,36 @@
package ledger
import (
"errors"
"time"
)
type OperatingMode string
const (
ModeNormal OperatingMode = "NORMAL"
ModeGLOnly OperatingMode = "GL_ONLY"
InternalExecutionMetadata = "gl_execution"
)
var (
ErrModeConflict = errors.New("operating mode revision changed")
ErrModeRequired = errors.New("operation is not permitted in the current ledger mode")
ErrInsufficientFunds = errors.New("insufficient ledger funds")
ErrSettlementInFlight = errors.New("settlement is in flight; drain the worker before switching")
ErrConcurrentPosting = errors.New("concurrent posting conflicted; retry with the same idempotency key")
)
type OperatingState struct {
Mode OperatingMode
Revision int64
ActorID string
Reason string
ChangedAt time.Time
}
type UserAssetBalance struct {
AssetID int64
Available Amount
Frozen Amount
}