diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-12-19 10:22:38 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:55 +0800 |
commit | 38c9e34a926f9dc924bfe54cf25c15139acf725b (patch) | |
tree | c242d3d0aca20eb224dcd7484c305cce7c06507a /core | |
parent | bc4641dacfa16b319e687fd4e376ed7ba20e61ae (diff) | |
download | dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar.gz dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar.bz2 dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar.lz dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar.xz dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.tar.zst dexon-38c9e34a926f9dc924bfe54cf25c15139acf725b.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 867cfef5e..e8d96e5c8 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -1658,7 +1658,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) @@ -1668,7 +1667,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) @@ -1721,7 +1719,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) @@ -1745,7 +1742,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) @@ -1769,7 +1765,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) @@ -1802,7 +1797,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 3766d3ac0..23da3ea77 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 } |