mirror of
https://github.com/luxfi/relay.git
synced 2026-10-30 15:20:05 +00:00
luxfi/node is being retired. The vms, vms/artifacts and vms/types/fee packages it hosted now have a permanent home in luxfi/vm, so R-Chain imports them from there and no longer depends on the node at all. luxfi/vm v1.3.17 needs Go 1.26.5. Co-authored-by: Hanzo Dev <[email protected]>
24 lines
772 B
Go
24 lines
772 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package vm
|
|
|
|
import (
|
|
"github.com/luxfi/vm/vms/types/fee"
|
|
)
|
|
|
|
// gateUserTx refuses every caller — R-Chain accepts no user txs
|
|
// (relayer receipts arrive via consensus, not a mempool). Any
|
|
// service entry exposing itself as user-callable MUST route through
|
|
// this gate so the refusal is explicit, not implicit.
|
|
func (vm *VM) gateUserTx() error {
|
|
if vm.feePolicy == nil {
|
|
return fee.ErrChainAcceptsNoUserTxs
|
|
}
|
|
return vm.feePolicy.ValidateFee(0, fee.NoUserTxPolicy{}.FeeAssetID())
|
|
}
|
|
|
|
// FeePolicy exposes the chain's declared fee policy for diagnostics
|
|
// and the boot-time Validate gate.
|
|
func (vm *VM) FeePolicy() fee.Policy { return vm.feePolicy }
|