Files
zeekay f480e48e39 run on the native fleet
Adds .hanzo/workflows/cicd.yml calling the canonical pipeline and drops the
GitHub-hosted workflows it replaces. Lands here because this is where the repo
is written — git.hanzo.ai is upstream and github.com is its push mirror, so the
same change made on github.com never reaches the runner fleet.
2026-08-20 20:20:25 -07:00

58 lines
1.6 KiB
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package executor
import (
"context"
"github.com/luxfi/ids"
log "github.com/luxfi/log"
"github.com/luxfi/proto/x/config"
"github.com/luxfi/proto/x/fxs"
"github.com/luxfi/proto/x/txs"
consContext "github.com/luxfi/runtime"
"github.com/luxfi/vm/chains/atomic"
"github.com/luxfi/vm/components/verify"
)
type Backend struct {
Ctx context.Context
LuxCtx *consContext.Context // Lux consensus context
Config *config.Config
Fxs []*fxs.ParsedFx
FxIndex *txs.FxIndex
// Note: FeeAssetID may be different than ctx.UTXOAssetID if this XVM is
// running in a chain.
FeeAssetID ids.ID
Bootstrapped bool
// Chain IDs for cross-chain operations
XChainID ids.ID
CChainID ids.ID
// Logger for this backend
Log log.Logger
// SharedMemory provides cross-chain atomic operations
SharedMemory atomic.SharedMemory
}
// ToChainContext creates a verify.ChainContext from this backend
func (b *Backend) ToChainContext() *verify.ChainContext {
return &verify.ChainContext{
ChainID: b.LuxCtx.ChainID,
NetID: b.LuxCtx.ChainID,
ValidatorState: &validatorStateAdapter{vs: b.LuxCtx.ValidatorState.(consContext.ValidatorState)},
}
}
// validatorStateAdapter adapts runtime.ValidatorState to verify.ValidatorState
type validatorStateAdapter struct {
vs consContext.ValidatorState
}
func (v *validatorStateAdapter) GetChainID(ctx context.Context, chainID ids.ID) (ids.ID, error) {
return v.vs.GetNetworkID(chainID)
}