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())
|
||||
if err == nil {
|
||||
return nil, &revertError{
|
||||
error: errors.New("execution reverted"),
|
||||
errData: reason,
|
||||
error: fmt.Errorf("execution reverted: %v", reason),
|
||||
errData: res.Revert(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -403,8 +403,8 @@ func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereu
|
||||
reason, err := abi.UnpackRevert(res.Revert())
|
||||
if err == nil {
|
||||
return nil, &revertError{
|
||||
error: errors.New("execution reverted"),
|
||||
errData: reason,
|
||||
error: fmt.Errorf("execution reverted: %v", reason),
|
||||
errData: res.Revert(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1053,8 +1053,8 @@ func TestSimulatedBackend_CallContractRevert(t *testing.T) {
|
||||
if !ok {
|
||||
t.Errorf("expect revert error")
|
||||
}
|
||||
if !reflect.DeepEqual(rerr.ErrorData(), val) {
|
||||
t.Errorf("error was malformed: got %v want %v", rerr.ErrorData(), val)
|
||||
if rerr.Error() != "execution reverted: "+val.(string) {
|
||||
t.Errorf("error was malformed: got %v want %v", rerr.Error(), val)
|
||||
}
|
||||
} else {
|
||||
// revert(0x0,0x0)
|
||||
|
@ -899,8 +899,8 @@ func (s *PublicBlockChainAPI) Call(ctx context.Context, args CallArgs, blockNrOr
|
||||
reason, err := abi.UnpackRevert(result.Revert())
|
||||
if err == nil {
|
||||
return nil, &revertError{
|
||||
error: errors.New("execution reverted"),
|
||||
errData: reason,
|
||||
error: fmt.Errorf("execution reverted: %v", reason),
|
||||
errData: result.Revert(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1003,8 +1003,8 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash
|
||||
reason, err := abi.UnpackRevert(result.Revert())
|
||||
if err == nil {
|
||||
return 0, &revertError{
|
||||
error: errors.New("execution reverted"),
|
||||
errData: reason,
|
||||
error: fmt.Errorf("execution reverted: %v", reason),
|
||||
errData: result.Revert(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user