@@ -28,15 +28,15 @@ func (pr *Prover) getAccountProof(height uint64) ([]byte, common.Hash, error) {
2828 return stateProof .AccountProofRLP , common .BytesToHash (stateProof .StorageHash [:]), nil
2929}
3030
31- func (pr * Prover ) getStateCommitmentProof (path []byte , height exported.Height ) ([]byte , error ) {
31+ func (pr * Prover ) getStateCommitmentProof (path []byte , height exported.Height ) ([]byte , [] byte , error ) {
3232 // calculate slot for commitment
3333 storageKey := crypto .Keccak256Hash (append (
3434 crypto .Keccak256Hash (path ).Bytes (),
3535 IBCCommitmentsSlot .Bytes ()... ,
3636 ))
3737 storageKeyHex , err := storageKey .MarshalText ()
3838 if err != nil {
39- return nil , fmt .Errorf ("failed to marshal slot: height = %d, %+v" , height .GetRevisionHeight (), err )
39+ return nil , nil , fmt .Errorf ("failed to marshal slot: height = %d, %+v" , height .GetRevisionHeight (), err )
4040 }
4141
4242 // call eth_getProof
@@ -46,10 +46,10 @@ func (pr *Prover) getStateCommitmentProof(path []byte, height exported.Height) (
4646 big .NewInt (int64 (height .GetRevisionHeight ())),
4747 )
4848 if err != nil {
49- return nil , fmt .Errorf ("failed to get state commitment proof : address = %s, height = %d, slot = %v, %+v" ,
49+ return nil , nil , fmt .Errorf ("failed to get state commitment proof : address = %s, height = %d, slot = %v, %+v" ,
5050 pr .chain .IBCAddress (), height .GetRevisionHeight (), storageKeyHex , err )
5151 }
52- return stateProof .StorageProofRLP [0 ], nil
52+ return stateProof .AccountProofRLP , stateProof . StorageProofRLP [0 ], nil
5353}
5454
5555func (pr * Prover ) GetStorageRoot (header * types.Header ) (common.Hash , error ) {
0 commit comments