mirror of
https://github.com/luxfi/relay.git
synced 2026-10-30 15:20:05 +00:00
Modules declare go 1.27.1 and the build images follow. go fix applied the modernizers; omitzero is not applied, since it changes what the JSON says. Co-authored-by: Hanzo Dev <[email protected]>
30 lines
766 B
Go
30 lines
766 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/ids"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/vm/vms"
|
|
)
|
|
|
|
var _ vms.Factory = (*Factory)(nil)
|
|
|
|
// VMID is the unique identifier for RelayVM (R-Chain)
|
|
var VMID = ids.ID{'r', 'e', 'l', 'a', 'y', 'v', 'm'}
|
|
|
|
// Factory creates new RelayVM instances
|
|
type Factory struct{}
|
|
|
|
// New returns a new instance of the RelayVM
|
|
func (f *Factory) New(logger log.Logger) (any, error) {
|
|
return &VM{
|
|
channels: make(map[ids.ID]*Channel),
|
|
messages: make(map[ids.ID]*Message),
|
|
pendingMsgs: make(map[ids.ID][]*Message),
|
|
sequences: make(map[ids.ID]uint64),
|
|
pendingBlocks: make(map[ids.ID]*Block),
|
|
}, nil
|
|
}
|