Six services, independently built then integrated: - services/wal (C): crash-safe write-ahead log, CRC32-checksummed frames, torn-write recovery via truncate-to-last-valid-frame. - services/ledger-core (Rust): double-entry ledger over the C WAL via FFI, reserve-floor enforcement BEFORE any WAL write, idempotent ApplyEntry, full LedgerCore gRPC service. - services/gateway (Go): Airwallex Issuing/Global-Accounts client (mock mode default, live mode ready), the actual rationing math (reserve floor, 60% bridge cap, 24h velocity cap, partial-over-decline). - services/agent (Go): deterministic hard-rule policy envelope computed BEFORE any LLM call; Claude only decides within that pre-approved envelope; every decision audit-logged even when the LLM call fails. - services/tui (Go, Bubble Tea) + services/cli (Go, cobra): the only UI — no web frontend, per explicit direction. Integration found and fixed three real bugs, not just compile errors: - proto regen collision shadowing checked-in pkg/pb packages - ledger-core/gateway address-variable mismatch (stack would never actually connect on default config) - the big one: MarkDepositReceived never credited the ledger, so every tenant's balance was permanently stuck at 0 and bridge-funding could only ever decline — the core agentic-rationing feature could never produce a real grant. Fixed at the ledger level with idempotent mark-and-credit in one WAL frame, covered by 3 new tests. End-to-end verified live, reproducibly: seed -> simulate a late deposit -> agent grants a partial bridge with a computed rationale -> second grant correctly declines once the 24h velocity cap engages. Verified independently by the orchestrator too: 'make build' and 'make test' both clean (Rust: 29 tests; Go: all packages; C: WAL test suite). Airwallex sandbox credentials still pending organizer approval — tracked as an owner blocker in docs/AIRWALLEX-SETUP.md, not a code gap.
596 lines
25 KiB
Go
596 lines
25 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v6.33.4
|
|
// source: ledger.proto
|
|
|
|
package ledger
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
LedgerCore_CreateTenant_FullMethodName = "/ration.ledger.v1.LedgerCore/CreateTenant"
|
|
LedgerCore_GetTenant_FullMethodName = "/ration.ledger.v1.LedgerCore/GetTenant"
|
|
LedgerCore_ListTenants_FullMethodName = "/ration.ledger.v1.LedgerCore/ListTenants"
|
|
LedgerCore_RecordDeposit_FullMethodName = "/ration.ledger.v1.LedgerCore/RecordDeposit"
|
|
LedgerCore_MarkDepositReceived_FullMethodName = "/ration.ledger.v1.LedgerCore/MarkDepositReceived"
|
|
LedgerCore_ListDeposits_FullMethodName = "/ration.ledger.v1.LedgerCore/ListDeposits"
|
|
LedgerCore_ListLateDeposits_FullMethodName = "/ration.ledger.v1.LedgerCore/ListLateDeposits"
|
|
LedgerCore_ApplyEntry_FullMethodName = "/ration.ledger.v1.LedgerCore/ApplyEntry"
|
|
LedgerCore_GetBalance_FullMethodName = "/ration.ledger.v1.LedgerCore/GetBalance"
|
|
LedgerCore_ListEntries_FullMethodName = "/ration.ledger.v1.LedgerCore/ListEntries"
|
|
LedgerCore_CheckReserveFloor_FullMethodName = "/ration.ledger.v1.LedgerCore/CheckReserveFloor"
|
|
LedgerCore_RecordAgentDecision_FullMethodName = "/ration.ledger.v1.LedgerCore/RecordAgentDecision"
|
|
LedgerCore_ListAgentDecisions_FullMethodName = "/ration.ledger.v1.LedgerCore/ListAgentDecisions"
|
|
)
|
|
|
|
// LedgerCoreClient is the client API for LedgerCore service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// LedgerCore is the authoritative source of truth for tenant balances,
|
|
// deposits, reserve floors and double-entry ledger history. Implemented
|
|
// in Rust, backed by a C write-ahead log (services/wal) for crash-safe
|
|
// durability. All money-moving decisions must go through this service —
|
|
// no other service is allowed to mutate balances directly.
|
|
type LedgerCoreClient interface {
|
|
CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*Tenant, error)
|
|
GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*Tenant, error)
|
|
ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error)
|
|
RecordDeposit(ctx context.Context, in *RecordDepositRequest, opts ...grpc.CallOption) (*Deposit, error)
|
|
MarkDepositReceived(ctx context.Context, in *MarkDepositReceivedRequest, opts ...grpc.CallOption) (*Deposit, error)
|
|
ListDeposits(ctx context.Context, in *ListDepositsRequest, opts ...grpc.CallOption) (*ListDepositsResponse, error)
|
|
ListLateDeposits(ctx context.Context, in *ListLateDepositsRequest, opts ...grpc.CallOption) (*ListDepositsResponse, error)
|
|
// ApplyEntry is the only way money moves. It is idempotent on
|
|
// idempotency_key and enforces the tenant's reserve floor for
|
|
// DEBIT and HOLD entries before committing to the WAL.
|
|
ApplyEntry(ctx context.Context, in *ApplyEntryRequest, opts ...grpc.CallOption) (*ApplyEntryResponse, error)
|
|
GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*Balance, error)
|
|
ListEntries(ctx context.Context, in *ListEntriesRequest, opts ...grpc.CallOption) (*ListEntriesResponse, error)
|
|
CheckReserveFloor(ctx context.Context, in *CheckReserveFloorRequest, opts ...grpc.CallOption) (*CheckReserveFloorResponse, error)
|
|
RecordAgentDecision(ctx context.Context, in *RecordAgentDecisionRequest, opts ...grpc.CallOption) (*AgentDecision, error)
|
|
ListAgentDecisions(ctx context.Context, in *ListAgentDecisionsRequest, opts ...grpc.CallOption) (*ListAgentDecisionsResponse, error)
|
|
}
|
|
|
|
type ledgerCoreClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewLedgerCoreClient(cc grpc.ClientConnInterface) LedgerCoreClient {
|
|
return &ledgerCoreClient{cc}
|
|
}
|
|
|
|
func (c *ledgerCoreClient) CreateTenant(ctx context.Context, in *CreateTenantRequest, opts ...grpc.CallOption) (*Tenant, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Tenant)
|
|
err := c.cc.Invoke(ctx, LedgerCore_CreateTenant_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) GetTenant(ctx context.Context, in *GetTenantRequest, opts ...grpc.CallOption) (*Tenant, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Tenant)
|
|
err := c.cc.Invoke(ctx, LedgerCore_GetTenant_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ListTenants(ctx context.Context, in *ListTenantsRequest, opts ...grpc.CallOption) (*ListTenantsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListTenantsResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ListTenants_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) RecordDeposit(ctx context.Context, in *RecordDepositRequest, opts ...grpc.CallOption) (*Deposit, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Deposit)
|
|
err := c.cc.Invoke(ctx, LedgerCore_RecordDeposit_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) MarkDepositReceived(ctx context.Context, in *MarkDepositReceivedRequest, opts ...grpc.CallOption) (*Deposit, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Deposit)
|
|
err := c.cc.Invoke(ctx, LedgerCore_MarkDepositReceived_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ListDeposits(ctx context.Context, in *ListDepositsRequest, opts ...grpc.CallOption) (*ListDepositsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListDepositsResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ListDeposits_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ListLateDeposits(ctx context.Context, in *ListLateDepositsRequest, opts ...grpc.CallOption) (*ListDepositsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListDepositsResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ListLateDeposits_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ApplyEntry(ctx context.Context, in *ApplyEntryRequest, opts ...grpc.CallOption) (*ApplyEntryResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ApplyEntryResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ApplyEntry_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*Balance, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Balance)
|
|
err := c.cc.Invoke(ctx, LedgerCore_GetBalance_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ListEntries(ctx context.Context, in *ListEntriesRequest, opts ...grpc.CallOption) (*ListEntriesResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListEntriesResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ListEntries_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) CheckReserveFloor(ctx context.Context, in *CheckReserveFloorRequest, opts ...grpc.CallOption) (*CheckReserveFloorResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CheckReserveFloorResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_CheckReserveFloor_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) RecordAgentDecision(ctx context.Context, in *RecordAgentDecisionRequest, opts ...grpc.CallOption) (*AgentDecision, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AgentDecision)
|
|
err := c.cc.Invoke(ctx, LedgerCore_RecordAgentDecision_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *ledgerCoreClient) ListAgentDecisions(ctx context.Context, in *ListAgentDecisionsRequest, opts ...grpc.CallOption) (*ListAgentDecisionsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListAgentDecisionsResponse)
|
|
err := c.cc.Invoke(ctx, LedgerCore_ListAgentDecisions_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// LedgerCoreServer is the server API for LedgerCore service.
|
|
// All implementations must embed UnimplementedLedgerCoreServer
|
|
// for forward compatibility.
|
|
//
|
|
// LedgerCore is the authoritative source of truth for tenant balances,
|
|
// deposits, reserve floors and double-entry ledger history. Implemented
|
|
// in Rust, backed by a C write-ahead log (services/wal) for crash-safe
|
|
// durability. All money-moving decisions must go through this service —
|
|
// no other service is allowed to mutate balances directly.
|
|
type LedgerCoreServer interface {
|
|
CreateTenant(context.Context, *CreateTenantRequest) (*Tenant, error)
|
|
GetTenant(context.Context, *GetTenantRequest) (*Tenant, error)
|
|
ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error)
|
|
RecordDeposit(context.Context, *RecordDepositRequest) (*Deposit, error)
|
|
MarkDepositReceived(context.Context, *MarkDepositReceivedRequest) (*Deposit, error)
|
|
ListDeposits(context.Context, *ListDepositsRequest) (*ListDepositsResponse, error)
|
|
ListLateDeposits(context.Context, *ListLateDepositsRequest) (*ListDepositsResponse, error)
|
|
// ApplyEntry is the only way money moves. It is idempotent on
|
|
// idempotency_key and enforces the tenant's reserve floor for
|
|
// DEBIT and HOLD entries before committing to the WAL.
|
|
ApplyEntry(context.Context, *ApplyEntryRequest) (*ApplyEntryResponse, error)
|
|
GetBalance(context.Context, *GetBalanceRequest) (*Balance, error)
|
|
ListEntries(context.Context, *ListEntriesRequest) (*ListEntriesResponse, error)
|
|
CheckReserveFloor(context.Context, *CheckReserveFloorRequest) (*CheckReserveFloorResponse, error)
|
|
RecordAgentDecision(context.Context, *RecordAgentDecisionRequest) (*AgentDecision, error)
|
|
ListAgentDecisions(context.Context, *ListAgentDecisionsRequest) (*ListAgentDecisionsResponse, error)
|
|
mustEmbedUnimplementedLedgerCoreServer()
|
|
}
|
|
|
|
// UnimplementedLedgerCoreServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedLedgerCoreServer struct{}
|
|
|
|
func (UnimplementedLedgerCoreServer) CreateTenant(context.Context, *CreateTenantRequest) (*Tenant, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method CreateTenant not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) GetTenant(context.Context, *GetTenantRequest) (*Tenant, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetTenant not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ListTenants(context.Context, *ListTenantsRequest) (*ListTenantsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListTenants not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) RecordDeposit(context.Context, *RecordDepositRequest) (*Deposit, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method RecordDeposit not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) MarkDepositReceived(context.Context, *MarkDepositReceivedRequest) (*Deposit, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method MarkDepositReceived not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ListDeposits(context.Context, *ListDepositsRequest) (*ListDepositsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListDeposits not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ListLateDeposits(context.Context, *ListLateDepositsRequest) (*ListDepositsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListLateDeposits not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ApplyEntry(context.Context, *ApplyEntryRequest) (*ApplyEntryResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ApplyEntry not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) GetBalance(context.Context, *GetBalanceRequest) (*Balance, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetBalance not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ListEntries(context.Context, *ListEntriesRequest) (*ListEntriesResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListEntries not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) CheckReserveFloor(context.Context, *CheckReserveFloorRequest) (*CheckReserveFloorResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method CheckReserveFloor not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) RecordAgentDecision(context.Context, *RecordAgentDecisionRequest) (*AgentDecision, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method RecordAgentDecision not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) ListAgentDecisions(context.Context, *ListAgentDecisionsRequest) (*ListAgentDecisionsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ListAgentDecisions not implemented")
|
|
}
|
|
func (UnimplementedLedgerCoreServer) mustEmbedUnimplementedLedgerCoreServer() {}
|
|
func (UnimplementedLedgerCoreServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeLedgerCoreServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to LedgerCoreServer will
|
|
// result in compilation errors.
|
|
type UnsafeLedgerCoreServer interface {
|
|
mustEmbedUnimplementedLedgerCoreServer()
|
|
}
|
|
|
|
func RegisterLedgerCoreServer(s grpc.ServiceRegistrar, srv LedgerCoreServer) {
|
|
// If the following call panics, it indicates UnimplementedLedgerCoreServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&LedgerCore_ServiceDesc, srv)
|
|
}
|
|
|
|
func _LedgerCore_CreateTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateTenantRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).CreateTenant(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_CreateTenant_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).CreateTenant(ctx, req.(*CreateTenantRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_GetTenant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetTenantRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).GetTenant(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_GetTenant_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).GetTenant(ctx, req.(*GetTenantRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ListTenants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListTenantsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ListTenants(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ListTenants_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ListTenants(ctx, req.(*ListTenantsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_RecordDeposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RecordDepositRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).RecordDeposit(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_RecordDeposit_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).RecordDeposit(ctx, req.(*RecordDepositRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_MarkDepositReceived_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MarkDepositReceivedRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).MarkDepositReceived(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_MarkDepositReceived_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).MarkDepositReceived(ctx, req.(*MarkDepositReceivedRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ListDeposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListDepositsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ListDeposits(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ListDeposits_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ListDeposits(ctx, req.(*ListDepositsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ListLateDeposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListLateDepositsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ListLateDeposits(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ListLateDeposits_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ListLateDeposits(ctx, req.(*ListLateDepositsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ApplyEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ApplyEntryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ApplyEntry(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ApplyEntry_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ApplyEntry(ctx, req.(*ApplyEntryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetBalanceRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).GetBalance(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_GetBalance_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).GetBalance(ctx, req.(*GetBalanceRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ListEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListEntriesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ListEntries(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ListEntries_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ListEntries(ctx, req.(*ListEntriesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_CheckReserveFloor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CheckReserveFloorRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).CheckReserveFloor(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_CheckReserveFloor_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).CheckReserveFloor(ctx, req.(*CheckReserveFloorRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_RecordAgentDecision_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RecordAgentDecisionRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).RecordAgentDecision(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_RecordAgentDecision_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).RecordAgentDecision(ctx, req.(*RecordAgentDecisionRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _LedgerCore_ListAgentDecisions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListAgentDecisionsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(LedgerCoreServer).ListAgentDecisions(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: LedgerCore_ListAgentDecisions_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(LedgerCoreServer).ListAgentDecisions(ctx, req.(*ListAgentDecisionsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// LedgerCore_ServiceDesc is the grpc.ServiceDesc for LedgerCore service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var LedgerCore_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ration.ledger.v1.LedgerCore",
|
|
HandlerType: (*LedgerCoreServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateTenant",
|
|
Handler: _LedgerCore_CreateTenant_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetTenant",
|
|
Handler: _LedgerCore_GetTenant_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListTenants",
|
|
Handler: _LedgerCore_ListTenants_Handler,
|
|
},
|
|
{
|
|
MethodName: "RecordDeposit",
|
|
Handler: _LedgerCore_RecordDeposit_Handler,
|
|
},
|
|
{
|
|
MethodName: "MarkDepositReceived",
|
|
Handler: _LedgerCore_MarkDepositReceived_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListDeposits",
|
|
Handler: _LedgerCore_ListDeposits_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListLateDeposits",
|
|
Handler: _LedgerCore_ListLateDeposits_Handler,
|
|
},
|
|
{
|
|
MethodName: "ApplyEntry",
|
|
Handler: _LedgerCore_ApplyEntry_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetBalance",
|
|
Handler: _LedgerCore_GetBalance_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListEntries",
|
|
Handler: _LedgerCore_ListEntries_Handler,
|
|
},
|
|
{
|
|
MethodName: "CheckReserveFloor",
|
|
Handler: _LedgerCore_CheckReserveFloor_Handler,
|
|
},
|
|
{
|
|
MethodName: "RecordAgentDecision",
|
|
Handler: _LedgerCore_RecordAgentDecision_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListAgentDecisions",
|
|
Handler: _LedgerCore_ListAgentDecisions_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "ledger.proto",
|
|
}
|