From db2adc3a099b0f6a815ebbd335a2ec06fd00b2fd Mon Sep 17 00:00:00 2001 From: lmcmz Date: Wed, 10 Nov 2021 02:38:34 +1100 Subject: [PATCH] Add convinent init method --- README.md | 3 ++- Sources/Flow/Models/FlowArgument.swift | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d4d1c3..33da14d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Contribute ยท Report a Bug

-
+ +
## Overview diff --git a/Sources/Flow/Models/FlowArgument.swift b/Sources/Flow/Models/FlowArgument.swift index ad20a16..76db9a6 100644 --- a/Sources/Flow/Models/FlowArgument.swift +++ b/Sources/Flow/Models/FlowArgument.swift @@ -279,6 +279,11 @@ extension Flow.Argument { public let name: String public let value: Flow.Argument + public init(name: String, value: Flow.Cadence.FValue) { + self.name = name + self.value = value.toArgument() + } + public init(name: String, value: Flow.Argument) { self.name = name self.value = value @@ -303,6 +308,11 @@ extension Flow.Argument { public let key: Flow.Argument public let value: Flow.Argument + public init(key: Flow.Cadence.FValue, value: Flow.Cadence.FValue) { + self.key = key.toArgument() + self.value = value.toArgument() + } + public init(key: Flow.Argument, value: Flow.Argument) { self.key = key self.value = value