internal/ethapi: added binary data to revertError data
This commit is contained in:
committed by
Péter Szilágyi
parent
4515f84958
commit
c9deb8a227
@ -380,8 +380,8 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM
|
|||||||
reason, err := abi.UnpackRevert(res.Revert())
|
reason, err := abi.UnpackRevert(res.Revert())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil, &revertError{
|
return nil, &revertError{
|
||||||
error: errors.New("execution reverted"),
|
error: fmt.Errorf("execution reverted: %v", reason),
|
||||||
errData: reason,
|
errData: res.Revert(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -403,8 +403,8 @@ func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereu
|
|||||||
reason, err := abi.UnpackRevert(res.Revert())
|
reason, err := abi.UnpackRevert(res.Revert())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil, &revertError{
|
return nil, &revertError{
|
||||||
error: errors.New("execution reverted"),
|
error: fmt.Errorf("execution reverted: %v", reason),
|
||||||
errData: reason,
|
errData: res.Revert(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1053,8 +1053,8 @@ func TestSimulatedBackend_CallContractRevert(t *testing.T) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
t.Errorf("expect revert error")
|
t.Errorf("expect revert error")
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(rerr.ErrorData(), val) {
|
if rerr.Error() != "execution reverted: "+val.(string) {
|
||||||
t.Errorf("error was malformed: got %v want %v", rerr.ErrorData(), val)
|
t.Errorf("error was malformed: got %v want %v", rerr.Error(), val)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// revert(0x0,0x0)
|
// revert(0x0,0x0)
|
||||||
|
@ -899,8 +899,8 @@ func (s *PublicBlockChainAPI) Call(ctx context.Context, args CallArgs, blockNrOr
|
|||||||
reason, err := abi.UnpackRevert(result.Revert())
|
reason, err := abi.UnpackRevert(result.Revert())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil, &revertError{
|
return nil, &revertError{
|
||||||
error: errors.New("execution reverted"),
|
error: fmt.Errorf("execution reverted: %v", reason),
|
||||||
errData: reason,
|
errData: result.Revert(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1003,8 +1003,8 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash
|
|||||||
reason, err := abi.UnpackRevert(result.Revert())
|
reason, err := abi.UnpackRevert(result.Revert())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return 0, &revertError{
|
return 0, &revertError{
|
||||||
error: errors.New("execution reverted"),
|
error: fmt.Errorf("execution reverted: %v", reason),
|
||||||
errData: reason,
|
errData: result.Revert(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user