mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
- Changed plugin/main.go to use vm/vms/rpcchainvm - Changed tests/warp/warp_test.go to use vm/vms/platformvm This breaks the circular dependency between coreth and node.
28 lines
751 B
Go
28 lines
751 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package message
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/luxfi/codec"
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
// Request represents a Network request type
|
|
type Request interface {
|
|
// Requests should implement String() for logging.
|
|
fmt.Stringer
|
|
|
|
// Handle allows `Request` to call respective methods on handler to handle
|
|
// this particular request type
|
|
Handle(ctx context.Context, nodeID ids.NodeID, requestID uint32, handler RequestHandler) ([]byte, error)
|
|
}
|
|
|
|
// RequestToBytes marshals the given request object into bytes
|
|
func RequestToBytes(codec codec.Manager, request Request) ([]byte, error) {
|
|
return codec.Marshal(Version, &request)
|
|
}
|