mirror of https://github.com/poanetwork/gecko.git
merged
This commit is contained in:
commit
93ff9d906b
|
@ -31,10 +31,10 @@ var (
|
|||
type BaseTx struct {
|
||||
ava.Metadata
|
||||
|
||||
NetID uint32 `serialize:"true"` // ID of the network this chain lives on
|
||||
BCID ids.ID `serialize:"true"` // ID of the chain on which this transaction exists (prevents replay attacks)
|
||||
Outs []*ava.TransferableOutput `serialize:"true"` // The outputs of this transaction
|
||||
Ins []*ava.TransferableInput `serialize:"true"` // The inputs to this transaction
|
||||
NetID uint32 `serialize:"true" json:"networkID"` // ID of the network this chain lives on
|
||||
BCID ids.ID `serialize:"true" json:"blockchainID"` // ID of the chain on which this transaction exists (prevents replay attacks)
|
||||
Outs []*ava.TransferableOutput `serialize:"true" json:"outputs"` // The outputs of this transaction
|
||||
Ins []*ava.TransferableInput `serialize:"true" json:"inputs"` // The inputs to this transaction
|
||||
}
|
||||
|
||||
// InputUTXOs track which UTXOs this transaction is consuming.
|
||||
|
|
|
@ -33,10 +33,10 @@ var (
|
|||
// CreateAssetTx is a transaction that creates a new asset.
|
||||
type CreateAssetTx struct {
|
||||
BaseTx `serialize:"true"`
|
||||
Name string `serialize:"true"`
|
||||
Symbol string `serialize:"true"`
|
||||
Denomination byte `serialize:"true"`
|
||||
States []*InitialState `serialize:"true"`
|
||||
Name string `serialize:"true" json:"name"`
|
||||
Symbol string `serialize:"true" json:"symbol"`
|
||||
Denomination byte `serialize:"true" json:"denomination"`
|
||||
States []*InitialState `serialize:"true" json:"initialStates"`
|
||||
}
|
||||
|
||||
// InitialStates track which virtual machines, and the initial state of these
|
||||
|
|
|
@ -19,8 +19,8 @@ var (
|
|||
|
||||
// InitialState ...
|
||||
type InitialState struct {
|
||||
FxID uint32 `serialize:"true"`
|
||||
Outs []verify.Verifiable `serialize:"true"`
|
||||
FxID uint32 `serialize:"true" json:"fxID"`
|
||||
Outs []verify.Verifiable `serialize:"true" json:"outputs"`
|
||||
}
|
||||
|
||||
// Verify implements the verify.Verifiable interface
|
||||
|
|
|
@ -14,9 +14,6 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
errNilOperableOutput = errors.New("nil operable output is not valid")
|
||||
errNilOperableFxOutput = errors.New("nil operable feature extension output is not valid")
|
||||
|
||||
errNilOperableInput = errors.New("nil operable input is not valid")
|
||||
errNilOperableFxInput = errors.New("nil operable feature extension input is not valid")
|
||||
)
|
||||
|
@ -25,7 +22,7 @@ var (
|
|||
type OperableInput struct {
|
||||
ava.UTXOID `serialize:"true"`
|
||||
|
||||
In verify.Verifiable `serialize:"true"`
|
||||
In verify.Verifiable `serialize:"true" json:"input"`
|
||||
}
|
||||
|
||||
// Input returns the feature extension input that this Input is using.
|
||||
|
|
|
@ -23,8 +23,8 @@ var (
|
|||
type Operation struct {
|
||||
ava.Asset `serialize:"true"`
|
||||
|
||||
Ins []*OperableInput `serialize:"true"`
|
||||
Outs []verify.Verifiable `serialize:"true"`
|
||||
Ins []*OperableInput `serialize:"true" json:"inputs"`
|
||||
Outs []verify.Verifiable `serialize:"true" json:"outputs"`
|
||||
}
|
||||
|
||||
// Verify implements the verify.Verifiable interface
|
||||
|
|
|
@ -23,7 +23,7 @@ var (
|
|||
// OperationTx is a transaction with no credentials.
|
||||
type OperationTx struct {
|
||||
BaseTx `serialize:"true"`
|
||||
Ops []*Operation `serialize:"true"`
|
||||
Ops []*Operation `serialize:"true" json:"operations"`
|
||||
}
|
||||
|
||||
// Operations track which ops this transaction is performing. The returned array
|
||||
|
|
|
@ -39,9 +39,9 @@ type UnsignedTx interface {
|
|||
// attempting to consume and the inputs consume sufficient state to produce the
|
||||
// outputs.
|
||||
type Tx struct {
|
||||
UnsignedTx `serialize:"true"`
|
||||
UnsignedTx `serialize:"true" json:"unsignedTx"`
|
||||
|
||||
Creds []verify.Verifiable `serialize:"true"` // The credentials of this transaction
|
||||
Creds []verify.Verifiable `serialize:"true" json:"credentials"` // The credentials of this transaction
|
||||
}
|
||||
|
||||
// Credentials describes the authorization that allows the Inputs to consume the
|
||||
|
|
|
@ -24,7 +24,6 @@ var (
|
|||
// performance boost
|
||||
type UniqueTx struct {
|
||||
*TxState
|
||||
|
||||
vm *VM
|
||||
txID ids.ID
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ var (
|
|||
|
||||
// Asset ...
|
||||
type Asset struct {
|
||||
ID ids.ID `serialize:"true"`
|
||||
ID ids.ID `serialize:"true" json:"assetID"`
|
||||
}
|
||||
|
||||
// AssetID returns the ID of the contained asset
|
||||
|
|
|
@ -36,7 +36,7 @@ type Transferable interface {
|
|||
type TransferableOutput struct {
|
||||
Asset `serialize:"true"`
|
||||
|
||||
Out Transferable `serialize:"true"`
|
||||
Out Transferable `serialize:"true" json:"output"`
|
||||
}
|
||||
|
||||
// Output returns the feature extension output that this Output is using.
|
||||
|
@ -101,7 +101,7 @@ type TransferableInput struct {
|
|||
UTXOID `serialize:"true"`
|
||||
Asset `serialize:"true"`
|
||||
|
||||
In Transferable `serialize:"true"`
|
||||
In Transferable `serialize:"true" json:"input"`
|
||||
}
|
||||
|
||||
// Input returns the feature extension input that this Input is using.
|
||||
|
|
|
@ -19,7 +19,7 @@ type UTXO struct {
|
|||
UTXOID `serialize:"true"`
|
||||
Asset `serialize:"true"`
|
||||
|
||||
Out verify.Verifiable `serialize:"true"`
|
||||
Out verify.Verifiable `serialize:"true" json:"output"`
|
||||
}
|
||||
|
||||
// Verify implements the verify.Verifiable interface
|
||||
|
|
|
@ -17,8 +17,8 @@ var (
|
|||
// UTXOID ...
|
||||
type UTXOID struct {
|
||||
// Serialized:
|
||||
TxID ids.ID `serialize:"true"`
|
||||
OutputIndex uint32 `serialize:"true"`
|
||||
TxID ids.ID `serialize:"true" json:"txID"`
|
||||
OutputIndex uint32 `serialize:"true" json:"outputIndex"`
|
||||
|
||||
// Symbol is false if the UTXO should be part of the DB
|
||||
Symbol bool
|
||||
|
|
|
@ -15,7 +15,7 @@ var (
|
|||
|
||||
// Credential ...
|
||||
type Credential struct {
|
||||
Sigs [][crypto.SECP256K1RSigLen]byte `serialize:"true"`
|
||||
Sigs [][crypto.SECP256K1RSigLen]byte `serialize:"true" json:"signatures"`
|
||||
}
|
||||
|
||||
// Verify ...
|
||||
|
|
|
@ -16,7 +16,7 @@ var (
|
|||
|
||||
// Input ...
|
||||
type Input struct {
|
||||
SigIndices []uint32 `serialize:"true"`
|
||||
SigIndices []uint32 `serialize:"true" json:"signatureIndices"`
|
||||
}
|
||||
|
||||
// Verify this input is syntactically valid
|
||||
|
|
|
@ -18,8 +18,8 @@ var (
|
|||
|
||||
// OutputOwners ...
|
||||
type OutputOwners struct {
|
||||
Threshold uint32 `serialize:"true"`
|
||||
Addrs []ids.ShortID `serialize:"true"`
|
||||
Threshold uint32 `serialize:"true" json:"threshold"`
|
||||
Addrs []ids.ShortID `serialize:"true" json:"addresses"`
|
||||
}
|
||||
|
||||
// Addresses returns the addresses that manage this output
|
||||
|
|
|
@ -13,7 +13,7 @@ var (
|
|||
|
||||
// TransferInput ...
|
||||
type TransferInput struct {
|
||||
Amt uint64 `serialize:"true"`
|
||||
Amt uint64 `serialize:"true" json:"amount"`
|
||||
Input `serialize:"true"`
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ var (
|
|||
|
||||
// TransferOutput ...
|
||||
type TransferOutput struct {
|
||||
Amt uint64 `serialize:"true"`
|
||||
Locktime uint64 `serialize:"true"`
|
||||
Amt uint64 `serialize:"true" json:"amount"`
|
||||
Locktime uint64 `serialize:"true" json:"locktime"`
|
||||
|
||||
OutputOwners `serialize:"true"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue