From 4ca414886375337dee3953c37c2585458da8f6ad Mon Sep 17 00:00:00 2001 From: ziyeziye Date: Mon, 11 Dec 2023 16:26:20 +0800 Subject: [PATCH] Support extension parameter return as is --- call.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/call.go b/call.go index 30f0ab7..1858891 100644 --- a/call.go +++ b/call.go @@ -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 {