mirror of
https://github.com/luxfi/vm.git
synced 2026-10-30 15:13:40 +00:00
Add vm/chain package with shared block caching infrastructure: - BlockWrapper: Smart caching layer for VM blocks - State: Block cache management (verified, decided, unverified) - Status: Block status enum (Unknown, Processing, Rejected, Accepted) Add Factory interface for VM instantiation. This consolidation allows evm, coreth, and node to import from github.com/luxfi/vm/chain without creating circular dependencies. The chain package replaces node/vms/components/chain/ and can now be imported directly by EVM implementations.
31 lines
543 B
Go
31 lines
543 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package chain
|
|
|
|
// Status represents the status of a block
|
|
type Status uint8
|
|
|
|
const (
|
|
Unknown Status = iota
|
|
Processing
|
|
Rejected
|
|
Accepted
|
|
)
|
|
|
|
// String returns the string representation of the status
|
|
func (s Status) String() string {
|
|
switch s {
|
|
case Unknown:
|
|
return "Unknown"
|
|
case Processing:
|
|
return "Processing"
|
|
case Rejected:
|
|
return "Rejected"
|
|
case Accepted:
|
|
return "Accepted"
|
|
default:
|
|
return "Unknown"
|
|
}
|
|
}
|