<commit_before>package platformvm

import (
	"github.com/ava-labs/gecko/ids"
	"github.com/ava-labs/gecko/vms/components/ava"
)

// CommonTx contains fields common to many transaction types
// Should be embedded in transaction implementations
type CommonTx struct {
	vm *VM
	// true iff this transaction has already passed syntactic verification
	syntacticallyVerified bool
	// ID of this tx
	id ids.ID
	// Byte representation of this unsigned tx
	unsignedBytes []byte
	// Byte representation of the signed transaction (ie with credentials)
	bytes []byte
	// ID of the network on which this tx was issued
	NetworkID uint32 `serialize:"true"`
	// Input UTXOs
	Inputs []*ava.TransferableInput `serialize:"true"`
	// Output UTXOs
	Outputs []*ava.TransferableOutput `serialize:"true"`
}

// UnsignedBytes returns the byte representation of this unsigned tx
func (tx CommonTx) UnsignedBytes() []byte {
	return tx.unsignedBytes
}

// Bytes returns the byte representation of this tx
func (tx CommonTx) Bytes() []byte {
	return tx.bytes
}

// ID returns this transaction's ID
func (tx CommonTx) ID() ids.ID { return tx.id }
<commit_msg>update commonTx format to match avm.baseTx<commit_after>package platformvm

import (
	"github.com/ava-labs/gecko/ids"
	"github.com/ava-labs/gecko/vms/components/ava"
)

// CommonTx contains fields common to many transaction types
// Should be embedded in transaction implementations
// The serialized fields of this struct should be exactly the same as those of avm.BaseTx
// Do not change this struct's serialized fields without doing the same on avm.BaseTx
// TODO: Factor out this and avm.BaseTX
type CommonTx struct {
	vm *VM
	// true iff this transaction has already passed syntactic verification
	syntacticallyVerified bool
	// ID of this tx
	id ids.ID
	// Byte representation of this unsigned tx
	unsignedBytes []byte
	// Byte representation of the signed transaction (ie with credentials)
	bytes []byte
	// ID of the network on which this tx was issued
	NetworkID uint32 `serialize:"true"`
	// ID of this blockchain. In practice is always the empty ID.
	// This is only here to match avm.BaseTx's format
	BlockchainID ids.ID                    `serialize:"true"`
	Outputs      []*ava.TransferableOutput `serialize:"true"`
	// Input UTXOs
	Inputs []*ava.TransferableInput `serialize:"true"`
}

// UnsignedBytes returns the byte representation of this unsigned tx
func (tx CommonTx) UnsignedBytes() []byte {
	return tx.unsignedBytes
}

// Bytes returns the byte representation of this tx
func (tx CommonTx) Bytes() []byte {
	return tx.bytes
}

// ID returns this transaction's ID
func (tx CommonTx) ID() ids.ID { return tx.id }

{'fraction_non_alphanumeric': 0.0879038317054846, 'fraction_numerical': 0.0015026296018031556, 'mean_word_length': 3.968283582089552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3280754', 'n_tokens_mistral': 772, 'n_tokens_neox': 756, 'n_words': 311}