Skip to content

Commit 4fc15ad

Browse files
chore: merged with remote updated branch
2 parents d745aca + de151ef commit 4fc15ad

File tree

128 files changed

+1522
-1271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1522
-1271
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Bug Report
2+
description: File a bug report.
3+
labels: ['bug']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
- type: textarea
10+
id: bug-description
11+
attributes:
12+
label: What happened?
13+
description: Please describe the bug.
14+
placeholder: Description of the bug.
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: steps-to-reproduce
19+
attributes:
20+
label: What are the steps to reproduce?
21+
description: Please describe the steps to reproduce the bug.
22+
placeholder: |
23+
Step 1: ...
24+
Step 2: ...
25+
Step 3: ...
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: expected-behavior
30+
attributes:
31+
label: What is the expected behavior?
32+
description: Please describe the behavior you expect.
33+
placeholder: I expect that...
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: error-thrown
38+
attributes:
39+
label: What is the error thrown?
40+
description: Please provide the exact error thrown.
41+
placeholder: Web3Error.invalidData("Exact error message")
42+
validations:
43+
required: true
44+
- type: textarea
45+
id: source-path
46+
attributes:
47+
label: What's the stack trace said?
48+
description: Please provide the exact source path.
49+
placeholder: Sources/Core/Transaction/CodableTransaction.swift:129 func recoverPublicKey()
50+
validations:
51+
required: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Documentation Request
2+
description: Suggest documentation you would like added
3+
labels: ['documentation']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this documentation request!
9+
- type: textarea
10+
id: area
11+
attributes:
12+
label: What area of the framework would you like to have improved the documentation for?
13+
description: Please be very specific and link to the relevant page in the documentation if possible.
14+
placeholder: I would like the documentation for...
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: reason
19+
attributes:
20+
label: Why is the current documentation for this area not sufficient?
21+
description: A clear and concise description of why this documentation needs to be improved.
22+
placeholder: The documentation needs to be improved because...
23+
validations:
24+
required: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
labels: ['feature']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this feature request!
9+
- type: textarea
10+
id: problem
11+
attributes:
12+
label: Is your feature request related to a problem?
13+
description: A clear and concise description of what the problem is.
14+
placeholder: Yes, the problem is that...
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: solution
19+
attributes:
20+
label: What solution would you like?
21+
description: A clear and concise description of what you want to happen.
22+
placeholder: I would like that...
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: alternatives
27+
attributes:
28+
label: What alternatives have you considered?
29+
description: A clear and concise description of any alternative solutions or features you've considered.
30+
placeholder: I have considered to...
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: context
35+
attributes:
36+
label: Any additional context?
37+
description: Add any other context or screenshots about the feature request here.

.github/workflows/macOS-11.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/macOS-12.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ on:
2222
- unstable
2323

2424
env:
25-
DEVELOPER_DIR: /Applications/Xcode_13.3.1.app/Contents/Developer
25+
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
2626

2727
jobs:
2828
spm:
29-
name: Swift Package Manager 5.5
29+
name: Swift Package Manager 5.7
3030
runs-on: macOS-12
3131
concurrency:
3232
group: spm-${{ github.run_id }}

Sources/Core/Contract/ContractProtocol.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import BigInt
6969
public protocol ContractProtocol {
7070
/// Address of the referenced smart contract. Can be set later, e.g. if the contract is deploying and address is not yet known.
7171
var address: EthereumAddress? {get set}
72-
72+
7373
/// All ABI elements like: events, functions, constructors and errors.
7474
var abi: [ABI.Element] {get}
7575

@@ -81,13 +81,13 @@ public protocol ContractProtocol {
8181
/// - and 4 bytes signature `0xffffffff` (expected to be lowercased).
8282
/// The mapping by name (e.g. `getData`) is the one most likely expected to return arrays with
8383
/// more than one entry due to the fact that solidity allows method overloading.
84-
var methods: [String:[ABI.Element.Function]] {get}
84+
var methods: [String: [ABI.Element.Function]] {get}
8585

8686
/// All values from ``methods``.
8787
var allMethods: [ABI.Element.Function] {get}
8888

8989
/// Events filtered from ``abi`` and mapped to their unchanged ``ABI/Element/Event/name``.
90-
var events: [String:ABI.Element.Event] {get}
90+
var events: [String: ABI.Element.Event] {get}
9191

9292
/// All values from ``events``.
9393
var allEvents: [ABI.Element.Event] {get}
@@ -225,7 +225,6 @@ extension DefaultContractProtocol {
225225
let parameters = parameters,
226226
!parameters.isEmpty {
227227
guard constructor.inputs.count == parameters.count,
228-
// FIXME: This should be zipped, because Arrays don't guarantee it's elements order
229228
let encodedData = constructor.encodeParameters(parameters) else {
230229
NSLog("Constructor encoding will fail as the number of input arguments doesn't match the number of given arguments.")
231230
return nil
@@ -278,11 +277,10 @@ extension DefaultContractProtocol {
278277

279278
public func parseEvent(_ eventLog: EventLog) -> (eventName: String?, eventData: [String: Any]?) {
280279
for (eName, ev) in self.events {
281-
if (!ev.anonymous) {
280+
if !ev.anonymous {
282281
if eventLog.topics[0] != ev.topic {
283282
continue
284-
}
285-
else {
283+
} else {
286284
let logTopics = eventLog.topics
287285
let logData = eventLog.data
288286
let parsed = ev.decodeReturnedLogs(eventLogTopics: logTopics, eventLogData: logData)

Sources/Core/Contract/EthereumContract.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import BigInt
1010
/// constructor, errors and optional ``EthereumAddress`` that could be set later.
1111
public class EthereumContract: DefaultContractProtocol {
1212

13-
public var address: EthereumAddress? = nil
13+
public var address: EthereumAddress?
1414

1515
public let abi: [ABI.Element]
1616
public let methods: [String: [ABI.Element.Function]]
@@ -40,7 +40,7 @@ public class EthereumContract: DefaultContractProtocol {
4040
public convenience required init(_ abiString: String, at: EthereumAddress? = nil) throws {
4141
let jsonData = abiString.data(using: .utf8)
4242
let abi = try JSONDecoder().decode([ABI.Record].self, from: jsonData!)
43-
let abiNative = try abi.map({ (record) -> ABI.Element in
43+
let abiNative = try abi.map({ record -> ABI.Element in
4444
return try record.parse()
4545
})
4646
try self.init(abi: abiNative, at: at)

0 commit comments

Comments
 (0)