Commit 5a27a0b6 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

fix: get merkle proof

parent 863b9a3b
......@@ -376,8 +376,7 @@ func (w *Witness) GetMerkleProof(address common.Address) (workload uint64, proof
if object == nil {
return 0, nil
}
payload := append(address.Bytes(), big.NewInt(0).SetUint64(object.Workload).Bytes()...)
payload := append(common.HexToAddress(object.Miner).Bytes(), common.LeftPadBytes(big.NewInt(0).SetUint64(object.Workload).Bytes(), 32)...)
leaf := crypto.Keccak256Hash(payload)
proofs, err := cacheTree.GetProof(leaf)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment