Files
zeekayandHanzo Dev b1cc108c9f gofmt
Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 01:51:51 -07:00

38 lines
1.0 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package builder
import (
"github.com/luxfi/constants"
"github.com/luxfi/ids"
"github.com/luxfi/node/vms/components/gas"
"github.com/luxfi/node/vms/platformvm/txs/fee"
"github.com/luxfi/runtime"
)
const Alias = "P"
type Context struct {
NetworkID uint32
ChainID ids.ID // Optional: if set, overrides default PlatformChainID
UTXOAssetID ids.ID
ComplexityWeights gas.Dimensions
GasPrice gas.Price
StaticFeeConfig fee.StaticConfig
}
func NewConsensusRuntime(networkID uint32, utxoAssetID ids.ID) (*runtime.Runtime, error) {
return NewConsensusRuntimeWithChainID(networkID, constants.PlatformChainID, utxoAssetID)
}
func NewConsensusRuntimeWithChainID(networkID uint32, chainID ids.ID, utxoAssetID ids.ID) (*runtime.Runtime, error) {
lookup := ids.NewAliaser()
rt := &runtime.Runtime{
NetworkID: networkID,
ChainID: chainID,
UTXOAssetID: utxoAssetID,
}
return rt, lookup.Alias(chainID, Alias)
}