remove TimeoutTx

This commit is contained in:
Jae Kwon
2014-10-12 17:57:23 -07:00
parent 7652c5d0de
commit f4b42cdfab
5 changed files with 85 additions and 71 deletions

View File

@ -46,11 +46,6 @@ func TestBlock(t *testing.T) {
Fee: RandUInt64Exp(),
}
timeoutTx := &TimeoutTx{
AccountId: RandUInt64Exp(),
Penalty: RandUInt64Exp(),
}
dupeoutTx := &DupeoutTx{
VoteA: Vote{
Height: RandUInt32Exp(),

View File

@ -14,8 +14,7 @@ Account Txs:
Validation Txs:
3. Bond New validator posts a bond
4. Unbond Validator leaves
5. Timeout Validator times out
6. Dupeout Validator dupes out (signs twice)
5. Dupeout Validator dupes out (signs twice)
*/
type Tx interface {
@ -31,8 +30,7 @@ const (
// Validation transactions
TxTypeBond = byte(0x11)
TxTypeUnbond = byte(0x12)
TxTypeTimeout = byte(0x13)
TxTypeDupeout = byte(0x14)
TxTypeDupeout = byte(0x13)
)
func ReadTx(r io.Reader, n *int64, err *error) Tx {
@ -62,12 +60,6 @@ func ReadTx(r io.Reader, n *int64, err *error) Tx {
BaseTx: ReadBaseTx(r, n, err),
Fee: ReadUInt64(r, n, err),
}
case TxTypeTimeout:
return &TimeoutTx{
BaseTx: ReadBaseTx(r, n, err),
AccountId: ReadUInt64(r, n, err),
Penalty: ReadUInt64(r, n, err),
}
case TxTypeDupeout:
return &DupeoutTx{
BaseTx: ReadBaseTx(r, n, err),
@ -180,22 +172,6 @@ func (tx *UnbondTx) WriteTo(w io.Writer) (n int64, err error) {
//-----------------------------------------------------------------------------
type TimeoutTx struct {
BaseTx
AccountId uint64
Penalty uint64
}
func (tx *TimeoutTx) WriteTo(w io.Writer) (n int64, err error) {
WriteByte(w, TxTypeTimeout, &n, &err)
WriteBinary(w, tx.BaseTx, &n, &err)
WriteUInt64(w, tx.AccountId, &n, &err)
WriteUInt64(w, tx.Penalty, &n, &err)
return
}
//-----------------------------------------------------------------------------
type DupeoutTx struct {
BaseTx
VoteA Vote