Skip to content

Commit fbe7fc9

Browse files
ryanioholgerd77
authored andcommitted
remove unpadBuffer from eth_call result
1 parent b3853b3 commit fbe7fc9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/client/lib/rpc/modules/eth.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
bufferToHex,
77
toBuffer,
88
stripHexPrefix,
9-
unpadBuffer,
109
setLengthLeft,
1110
} from 'ethereumjs-util'
1211
import { decode } from 'rlp'
@@ -149,7 +148,7 @@ export class Eth {
149148
}
150149

151150
const { execResult } = await vm.runTx({ tx })
152-
return bufferToHex(unpadBuffer(execResult.returnValue))
151+
return bufferToHex(execResult.returnValue)
153152
}
154153

155154
/**

packages/client/test/rpc/eth/call.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ tape(`${method}: call with valid arguments`, async (t) => {
6666
const req = params(method, [{ ...estimateTxData, gas: estimateTxData.gasLimit }, 'latest'])
6767
const expectRes = (res: any) => {
6868
const msg = 'should return the correct return value'
69-
if (res.body.result === bufferToHex(unpadBuffer(execResult.returnValue))) {
69+
if (res.body.result === bufferToHex(execResult.returnValue)) {
7070
t.pass(msg)
7171
} else {
7272
throw new Error(msg)

0 commit comments

Comments
 (0)