OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add cancel vote (#172)
[bytom/vapor.git]
/
protocol
/
bc
/
types
/
txinput.go
diff --git
a/protocol/bc/types/txinput.go
b/protocol/bc/types/txinput.go
index
7b9ba0e
..
47831cc
100644
(file)
--- a/
protocol/bc/types/txinput.go
+++ b/
protocol/bc/types/txinput.go
@@
-14,7
+14,7
@@
const (
CrossChainInputType uint8 = iota
SpendInputType
CoinbaseInputType
CrossChainInputType uint8 = iota
SpendInputType
CoinbaseInputType
-
Unvote
InputType
+
Veto
InputType
)
type (
)
type (
@@
-43,7
+43,7
@@
func (t *TxInput) AssetAmount() bc.AssetAmount {
case *CrossChainInput:
return inp.AssetAmount
case *CrossChainInput:
return inp.AssetAmount
- case *
Unvote
Input:
+ case *
Veto
Input:
return inp.AssetAmount
}
return inp.AssetAmount
}
@@
-59,7
+59,7
@@
func (t *TxInput) AssetID() bc.AssetID {
case *CrossChainInput:
return *inp.AssetAmount.AssetId
case *CrossChainInput:
return *inp.AssetAmount.AssetId
- case *
Unvote
Input:
+ case *
Veto
Input:
return *inp.AssetId
}
return *inp.AssetId
}
@@
-75,7
+75,7
@@
func (t *TxInput) Amount() uint64 {
case *CrossChainInput:
return inp.AssetAmount.Amount
case *CrossChainInput:
return inp.AssetAmount.Amount
- case *
Unvote
Input:
+ case *
Veto
Input:
return inp.Amount
}
return inp.Amount
}
@@
-91,7
+91,7
@@
func (t *TxInput) ControlProgram() []byte {
case *CrossChainInput:
return inp.ControlProgram
case *CrossChainInput:
return inp.ControlProgram
- case *
Unvote
Input:
+ case *
Veto
Input:
return inp.ControlProgram
}
return inp.ControlProgram
}
@@
-108,7
+108,7
@@
func (t *TxInput) Arguments() [][]byte {
case *CrossChainInput:
return inp.Arguments
case *CrossChainInput:
return inp.Arguments
- case *
Unvote
Input:
+ case *
Veto
Input:
return inp.Arguments
}
return nil
return inp.Arguments
}
return nil
@@
-123,7
+123,7
@@
func (t *TxInput) SetArguments(args [][]byte) {
case *CrossChainInput:
inp.Arguments = args
case *CrossChainInput:
inp.Arguments = args
- case *
Unvote
Input:
+ case *
Veto
Input:
inp.Arguments = args
}
}
inp.Arguments = args
}
}
@@
-134,8
+134,8
@@
func (t *TxInput) SpentOutputID() (o bc.Hash, err error) {
case *SpendInput:
o, err = ComputeOutputID(&inp.SpendCommitment, SpendInputType, nil)
case *SpendInput:
o, err = ComputeOutputID(&inp.SpendCommitment, SpendInputType, nil)
- case *
Unvote
Input:
- o, err = ComputeOutputID(&inp.SpendCommitment,
Unvote
InputType, inp.Vote)
+ case *
Veto
Input:
+ o, err = ComputeOutputID(&inp.SpendCommitment,
Veto
InputType, inp.Vote)
}
return o, err
}
return o, err
@@
-177,8
+177,8
@@
func (t *TxInput) readFrom(r *blockchain.Reader) (err error) {
return err
}
return err
}
- case
Unvote
InputType:
- ui := new(
Unvote
Input)
+ case
Veto
InputType:
+ ui := new(
Veto
Input)
t.TypedInput = ui
if ui.UnvoteCommitmentSuffix, err = ui.SpendCommitment.readFrom(r, 1); err != nil {
t.TypedInput = ui
if ui.UnvoteCommitmentSuffix, err = ui.SpendCommitment.readFrom(r, 1); err != nil {
@@
-210,7
+210,7
@@
func (t *TxInput) readFrom(r *blockchain.Reader) (err error) {
return err
}
return err
}
- case *
Unvote
Input:
+ case *
Veto
Input:
if inp.Arguments, err = blockchain.ReadVarstrList(r); err != nil {
return err
}
if inp.Arguments, err = blockchain.ReadVarstrList(r); err != nil {
return err
}
@@
-284,8
+284,8
@@
func (t *TxInput) writeInputCommitment(w io.Writer) (err error) {
return errors.Wrap(err, "writing coinbase arbitrary")
}
return errors.Wrap(err, "writing coinbase arbitrary")
}
- case *
Unvote
Input:
- if _, err = w.Write([]byte{
Unvote
InputType}); err != nil {
+ case *
Veto
Input:
+ if _, err = w.Write([]byte{
Veto
InputType}); err != nil {
return err
}
return inp.SpendCommitment.writeExtensibleString(w, inp.UnvoteCommitmentSuffix, t.AssetVersion)
return err
}
return inp.SpendCommitment.writeExtensibleString(w, inp.UnvoteCommitmentSuffix, t.AssetVersion)
@@
-306,7
+306,7
@@
func (t *TxInput) writeInputWitness(w io.Writer) error {
case *CrossChainInput:
_, err := blockchain.WriteVarstrList(w, inp.Arguments)
return err
case *CrossChainInput:
_, err := blockchain.WriteVarstrList(w, inp.Arguments)
return err
- case *
Unvote
Input:
+ case *
Veto
Input:
if _, err := blockchain.WriteVarstrList(w, inp.Arguments); err != nil {
return err
}
if _, err := blockchain.WriteVarstrList(w, inp.Arguments); err != nil {
return err
}