Support extension parameter return as is

This commit is contained in:
ziyeziye 2023-12-11 16:26:20 +08:00
parent 12c2d287e9
commit 4ca4148863

10
call.go
View file

@ -42,6 +42,7 @@ type Call struct {
CallName string
Contract *Contract
Method string
Extend any
Inputs []any
Outputs any
CanFail bool
@ -67,6 +68,15 @@ func (call *Call) Name(name string) *Call {
return call
}
func (call *Call) SetExtend(ext any) *Call {
call.Extend = ext
return call
}
func (call *Call) UnpackResult() []interface{} {
return call.Outputs.([]interface{})
}
// AllowFailure sets if the call is allowed to fail. This helps avoiding a revert
// when one of the calls in the array fails.
func (call *Call) AllowFailure() *Call {