mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
19 lines
453 B
Go
19 lines
453 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package atomic
|
|
|
|
import "github.com/luxfi/p2p/gossip"
|
|
|
|
var _ gossip.Marshaller[*Tx] = (*TxMarshaller)(nil)
|
|
|
|
type TxMarshaller struct{}
|
|
|
|
func (g *TxMarshaller) MarshalGossip(tx *Tx) ([]byte, error) {
|
|
return tx.SignedBytes(), nil
|
|
}
|
|
|
|
func (*TxMarshaller) UnmarshalGossip(bytes []byte) (*Tx, error) {
|
|
return ExtractAtomicTx(bytes, Codec)
|
|
}
|