rpc: make getproof
work with destroyed contracts
Now it's able to get proof for destroyed contract if the contract wasn't destroyed before the requested stateroot's height.
This commit is contained in:
parent
af9e39ced2
commit
55fb221bbb
1 changed files with 3 additions and 3 deletions
|
@ -991,9 +991,9 @@ func (s *Server) getProof(ps request.Params) (interface{}, *response.Error) {
|
|||
if err != nil {
|
||||
return nil, response.ErrInvalidParams
|
||||
}
|
||||
cs := s.chain.GetContractState(sc)
|
||||
if cs == nil {
|
||||
return nil, response.ErrInvalidParams
|
||||
cs, respErr := s.getHistoricalContractState(root, sc)
|
||||
if respErr != nil {
|
||||
return nil, respErr
|
||||
}
|
||||
skey := makeStorageKey(cs.ID, key)
|
||||
proof, err := s.chain.GetStateModule().GetStateProof(root, skey)
|
||||
|
|
Loading…
Reference in a new issue