|
@@ -599,7 +599,7 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
|
|
|
if storageError != nil {
|
|
if storageError != nil {
|
|
|
return nil, storageError
|
|
return nil, storageError
|
|
|
}
|
|
}
|
|
|
- storageProof[i] = StorageResult{key, (*hexutil.Big)(state.GetState(address, common.HexToHash(key)).Big()), common.ToHexArray(proof)}
|
|
|
|
|
|
|
+ storageProof[i] = StorageResult{key, (*hexutil.Big)(state.GetState(address, common.HexToHash(key)).Big()), toHexSlice(proof)}
|
|
|
} else {
|
|
} else {
|
|
|
storageProof[i] = StorageResult{key, &hexutil.Big{}, []string{}}
|
|
storageProof[i] = StorageResult{key, &hexutil.Big{}, []string{}}
|
|
|
}
|
|
}
|
|
@@ -613,7 +613,7 @@ func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Addre
|
|
|
|
|
|
|
|
return &AccountResult{
|
|
return &AccountResult{
|
|
|
Address: address,
|
|
Address: address,
|
|
|
- AccountProof: common.ToHexArray(accountProof),
|
|
|
|
|
|
|
+ AccountProof: toHexSlice(accountProof),
|
|
|
Balance: (*hexutil.Big)(state.GetBalance(address)),
|
|
Balance: (*hexutil.Big)(state.GetBalance(address)),
|
|
|
CodeHash: codeHash,
|
|
CodeHash: codeHash,
|
|
|
Nonce: hexutil.Uint64(state.GetNonce(address)),
|
|
Nonce: hexutil.Uint64(state.GetNonce(address)),
|
|
@@ -1943,3 +1943,12 @@ func checkTxFee(gasPrice *big.Int, gas uint64, cap float64) error {
|
|
|
}
|
|
}
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// toHexSlice creates a slice of hex-strings based on []byte.
|
|
|
|
|
+func toHexSlice(b [][]byte) []string {
|
|
|
|
|
+ r := make([]string, len(b))
|
|
|
|
|
+ for i := range b {
|
|
|
|
|
+ r[i] = hexutil.Encode(b[i])
|
|
|
|
|
+ }
|
|
|
|
|
+ return r
|
|
|
|
|
+}
|