diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-12-19 10:22:38 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 24d6c68a85db33930c7cdba7ad67f0512028619c (patch) | |
tree | f6cfb67c2d096468a8b18089ca49f21fee0ee893 /dex/app.go | |
parent | e677874800085b8b9a4d102d41d4b1218029308f (diff) | |
download | dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar.gz dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar.bz2 dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar.lz dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar.xz dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.tar.zst dexon-24d6c68a85db33930c7cdba7ad67f0512028619c.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 'dex/app.go')
-rw-r--r-- | dex/app.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/dex/app.go b/dex/app.go index 8da00d07b..9dcfd87e9 100644 --- a/dex/app.go +++ b/dex/app.go @@ -50,12 +50,6 @@ type DexconApp struct { chainLocks sync.Map } -type witnessData struct { - Root common.Hash - TxHash common.Hash - ReceiptHash common.Hash -} - func NewDexconApp(txPool *core.TxPool, blockchain *core.BlockChain, gov *DexconGovernance, chainDB ethdb.Database, config *Config) *DexconApp { return &DexconApp{ @@ -283,9 +277,8 @@ func (d *DexconApp) PrepareWitness(consensusHeight uint64) (witness coreTypes.Wi return witness, fmt.Errorf("last pending height < consensus height") } - witnessData, err := rlp.EncodeToBytes(&witnessData{ + witnessData, err := rlp.EncodeToBytes(&types.WitnessData{ Root: witnessBlock.Root(), - TxHash: witnessBlock.TxHash(), ReceiptHash: witnessBlock.ReceiptHash(), }) if err != nil { @@ -300,7 +293,7 @@ func (d *DexconApp) PrepareWitness(consensusHeight uint64) (witness coreTypes.Wi // VerifyBlock verifies if the payloads are valid. func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifyStatus { - var witnessData witnessData + var witnessData types.WitnessData err := rlp.DecodeBytes(block.Witness.Data, &witnessData) if err != nil { log.Error("failed to RLP decode witness data", "error", err) |