diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-12-19 10:22:38 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 7a6658c1b9fd55f822953ff20ec31fbe189c532e (patch) | |
tree | faa480371c163879481cd5599e98466cdb28ca7a /core | |
parent | 839aec15c1a253580463392b30d513952c887b0d (diff) | |
download | dexon-7a6658c1b9fd55f822953ff20ec31fbe189c532e.tar.gz dexon-7a6658c1b9fd55f822953ff20ec31fbe189c532e.tar.zst dexon-7a6658c1b9fd55f822953ff20ec31fbe189c532e.zip |
dex: remove duplicate declaration of WitnessData (#92)
Remove duplicate declaration of WitnessData and remove the TxHash field
in witness data since it does not need to be witnessed.
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain_test.go | 6 | ||||
-rw-r--r-- | core/types/block.go | 1 |
2 files changed, 0 insertions, 7 deletions
diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 9ee688f1c..ba0c8480f 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -1452,7 +1452,6 @@ func TestProcessPendingBlock(t *testing.T) { if i == 0 { witnessData := types.WitnessData{ Root: gspec.ToBlock(nil).Root(), - TxHash: gspec.ToBlock(nil).TxHash(), ReceiptHash: gspec.ToBlock(nil).ReceiptHash(), } witnessDataBytes, err = rlp.EncodeToBytes(&witnessData) @@ -1462,7 +1461,6 @@ func TestProcessPendingBlock(t *testing.T) { } else { witnessData := types.WitnessData{ Root: chain.pendingBlocks[uint64(i)].block.Root(), - TxHash: chain.pendingBlocks[uint64(i)].block.TxHash(), ReceiptHash: chain.pendingBlocks[uint64(i)].block.ReceiptHash(), } witnessDataBytes, err = rlp.EncodeToBytes(&witnessData) @@ -1515,7 +1513,6 @@ func TestProcessPendingBlock(t *testing.T) { // Validate witness fail with unknown block. witnessData := types.WitnessData{ Root: chain.pendingBlocks[processNum].block.Root(), - TxHash: chain.pendingBlocks[processNum].block.TxHash(), ReceiptHash: chain.pendingBlocks[processNum].block.ReceiptHash(), } witnessDataBytes, err := rlp.EncodeToBytes(&witnessData) @@ -1539,7 +1536,6 @@ func TestProcessPendingBlock(t *testing.T) { // Validate witness fail with unexpected root. witnessData = types.WitnessData{ Root: chain.pendingBlocks[processNum].block.Root(), - TxHash: chain.pendingBlocks[processNum].block.TxHash(), ReceiptHash: chain.pendingBlocks[processNum].block.ReceiptHash(), } witnessDataBytes, err = rlp.EncodeToBytes(&witnessData) @@ -1563,7 +1559,6 @@ func TestProcessPendingBlock(t *testing.T) { // Apply transaction fail with insufficient fund. witnessData = types.WitnessData{ Root: chain.pendingBlocks[processNum].block.Root(), - TxHash: chain.pendingBlocks[processNum].block.TxHash(), ReceiptHash: chain.pendingBlocks[processNum].block.ReceiptHash(), } witnessDataBytes, err = rlp.EncodeToBytes(&witnessData) @@ -1596,7 +1591,6 @@ func TestProcessPendingBlock(t *testing.T) { // Apply transaction fail with nonce too height. witnessData = types.WitnessData{ Root: chain.pendingBlocks[processNum].block.Root(), - TxHash: chain.pendingBlocks[processNum].block.TxHash(), ReceiptHash: chain.pendingBlocks[processNum].block.ReceiptHash(), } witnessDataBytes, err = rlp.EncodeToBytes(&witnessData) diff --git a/core/types/block.go b/core/types/block.go index 7ee6027a3..ae8eda3b1 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -67,7 +67,6 @@ func (n *BlockNonce) UnmarshalText(input []byte) error { // WitnessData represents the witness data. type WitnessData struct { Root common.Hash - TxHash common.Hash ReceiptHash common.Hash } |