mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-24 07:46:45 +00:00

* [NOD-1420] Start working on ConsensusStateManager. Might be redundant due to recent changes * [NOD-1420] Convert model to externalapi in utxo_algerbra helpers * [NOD-1420] Add UTXO-diff algebra * [NOD-1420] Prepare skeleton of calculateAcceptanceDataAndMultiset * [NOD-1420] Added skeleton for AddBlockToVirtual * [NOD-1420] Implement PopulateTransactionWithUTXOEntries * [NOD-1420] Implement restorePastUTXO * [NOD-1420] Implement finality check * [NOD-1420] Move handling of tips to consensusStateManager * [NOD-1420] Implement calculateAcceptanceDataAndMultiset * [NOD-1420] Start implementing resolveBlockStatus * [NOD-1420] Implement resolveBlockStatus * [NOD-1420] Update related fields in end of resolveSingleBlockStatus * [NOD-1420] Start working on selectVirtualParents * [NOD-1420] Implemented BlockHeap * [NOD-1420] Implement selectVirtualParents * [NOD-1420] Implement updateVirtual * [NOD-1420] Added comments where they were missing * [NOD-1420] Place all consensusStateManager functions in correct files * [NOD-1420] Return the missing outpoints from populateTransactionWithUTXOEntriesFromVirtualOrDiff * [NOD-1420] Outpoint.ID -> TransactionID * [NOD-1420] Fix Stringer tests * [NOD-1420] Copy hash.FromString into utils * [NOD-1420] SetParents should return an error * [NOD-1420] Remove all reachabilityManager references from consensusStateManager * [NOD-1420] Remove VirtualData. Get the info from the stores where needed * [NOD-1420] Invert parameters to IsAncestorOf * [NOD-1420] Use model.AcceptanceData * [NOD-1420] Don't return accumulatedMassBefore in error cases * [NOD-1420] Don't expect store functions to return nil when the requested data was found - instead add HasXXX functions * [NOD-1420] addTransactionToMultiset sets isCoinbase properly * [NOD-1420] expected hash string length is externalapi.DomainHashSize * 2 * [NOD-1420] Rename reachabilityTree -> reachabilityManager + updateReindexRoot if isNextVirtualSelectedParent * [NOD-1420] ValidateCoinbaseTransaction in csm.verifyAndBuildUTXO * [NOD-1420] Re-write HAsUTXODiffChild * [NOD-1420] delete past_utxo.go.bak * [NOD-1420] Implement validateCoinbaseTransaction in CSM * [NOD-1420] Imlemented missing functionality in ValidateTransactionAndPopulateWithConsensusData * [NOD-1420] Moved merge depth logic to MergeDepthManager * [NOD-1420] Add logs
63 lines
1.5 KiB
Go
63 lines
1.5 KiB
Go
package externalapi
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// DomainTransaction represents a Kaspa transaction
|
|
type DomainTransaction struct {
|
|
Version int32
|
|
Inputs []*DomainTransactionInput
|
|
Outputs []*DomainTransactionOutput
|
|
LockTime uint64
|
|
SubnetworkID DomainSubnetworkID
|
|
Gas uint64
|
|
PayloadHash DomainHash
|
|
Payload []byte
|
|
|
|
Fee uint64
|
|
Mass uint64
|
|
}
|
|
|
|
// DomainTransactionInput represents a Kaspa transaction input
|
|
type DomainTransactionInput struct {
|
|
PreviousOutpoint DomainOutpoint
|
|
SignatureScript []byte
|
|
Sequence uint64
|
|
|
|
UTXOEntry *UTXOEntry
|
|
}
|
|
|
|
// DomainOutpoint represents a Kaspa transaction outpoint
|
|
type DomainOutpoint struct {
|
|
TransactionID DomainTransactionID
|
|
Index uint32
|
|
}
|
|
|
|
// String stringifies an outpoint.
|
|
func (op DomainOutpoint) String() string {
|
|
return fmt.Sprintf("(%s: %d)", op.TransactionID, op.Index)
|
|
}
|
|
|
|
// NewDomainOutpoint instantiates a new DomainOutpoint with the given id and index
|
|
func NewDomainOutpoint(id *DomainTransactionID, index uint32) *DomainOutpoint {
|
|
return &DomainOutpoint{
|
|
TransactionID: *id,
|
|
Index: index,
|
|
}
|
|
}
|
|
|
|
// DomainTransactionOutput represents a Kaspad transaction output
|
|
type DomainTransactionOutput struct {
|
|
Value uint64
|
|
ScriptPublicKey []byte
|
|
}
|
|
|
|
// DomainTransactionID represents the ID of a Kaspa transaction
|
|
type DomainTransactionID DomainHash
|
|
|
|
// String stringifies a transaction ID.
|
|
func (id DomainTransactionID) String() string {
|
|
return DomainHash(id).String()
|
|
}
|