Files
coreth/plugin/evm/message/request.go
zeekay 1f3c4f30ba refactor: remove github.com/luxfi/node dependency
- 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.
2026-01-09 01:10:05 -08:00

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)
}