mirror of https://github.com/hyperledger/besu
Update eth_call handling of account balance (#1834)
When calling `eth_call` by default account balances will be ignored when executing the call. If the user wants the gas balance to be a consideration in the call a new `strict` param in the call params can be set to true, which will enforce the balance rules. This is the same behavior as is observed in `eth_estimateGas`. Addresses #502 Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>pull/1841/head
parent
ce104c0ec5
commit
e7a5b1cd4a
@ -1,24 +1,47 @@ |
||||
{ |
||||
"request": { |
||||
"id": 4, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"gasPrice": "0x10000000000000" |
||||
}, |
||||
"0x8" |
||||
] |
||||
}, |
||||
"response": { |
||||
"jsonrpc": "2.0", |
||||
"id": 4, |
||||
"error" : { |
||||
"code" : -32004, |
||||
"message" : "Upfront cost exceeds account balance" |
||||
"request": [ |
||||
{ |
||||
"id": 3, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"gasPrice": "0x10000000000000" |
||||
}, |
||||
"0x8" |
||||
] |
||||
}, |
||||
{ |
||||
"id": 4, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"gasPrice": "0x10000000000000", |
||||
"strict": true |
||||
}, |
||||
"0x8" |
||||
] |
||||
} |
||||
}, |
||||
], |
||||
"response": [ |
||||
{ |
||||
"jsonrpc": "2.0", |
||||
"id": 3, |
||||
"result": "0x" |
||||
}, |
||||
{ |
||||
"jsonrpc": "2.0", |
||||
"id": 4, |
||||
"error": { |
||||
"code": -32004, |
||||
"message": "Upfront cost exceeds account balance" |
||||
} |
||||
} |
||||
], |
||||
"statusCode": 200 |
||||
} |
@ -1,24 +1,47 @@ |
||||
{ |
||||
"request": { |
||||
"id": 4, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"value": "0x340ab63a021fc9aa" |
||||
}, |
||||
"0x8" |
||||
] |
||||
}, |
||||
"response": { |
||||
"jsonrpc": "2.0", |
||||
"id": 4, |
||||
"error" : { |
||||
"code" : -32004, |
||||
"message" : "Upfront cost exceeds account balance" |
||||
"request": [ |
||||
{ |
||||
"id": 3, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"value": "0x340ab63a021fc9aa" |
||||
}, |
||||
"0x8" |
||||
] |
||||
}, |
||||
{ |
||||
"id": 4, |
||||
"jsonrpc": "2.0", |
||||
"method": "eth_call", |
||||
"params": [ |
||||
{ |
||||
"to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", |
||||
"from": "a94f5374fce5edbc8e2a8697c15331677e6ebf0b", |
||||
"value": "0x340ab63a021fc9aa", |
||||
"strict": true |
||||
}, |
||||
"0x8" |
||||
] |
||||
} |
||||
}, |
||||
], |
||||
"response": [ |
||||
{ |
||||
"jsonrpc": "2.0", |
||||
"id": 3, |
||||
"result": "0x" |
||||
}, |
||||
{ |
||||
"jsonrpc": "2.0", |
||||
"id": 4, |
||||
"error": { |
||||
"code": -32004, |
||||
"message": "Upfront cost exceeds account balance" |
||||
} |
||||
} |
||||
], |
||||
"statusCode": 200 |
||||
} |
Loading…
Reference in new issue