-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe40311
commit 4b56a9f
Showing
13 changed files
with
127 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 11 additions & 61 deletions
72
Sources/Starknet/Data/Transaction/Data/ExecutionResources.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,28 @@ | ||
import Foundation | ||
|
||
public protocol StarknetResources: Decodable, Equatable { | ||
var steps: Int { get } | ||
var memoryHoles: Int? { get } | ||
var rangeCheckApplications: Int? { get } | ||
var pedersenApplications: Int? { get } | ||
var poseidonApplications: Int? { get } | ||
var ecOpApplications: Int? { get } | ||
var ecdsaApplications: Int? { get } | ||
var bitwiseApplications: Int? { get } | ||
var keccakApplications: Int? { get } | ||
var segmentArena: Int? { get } | ||
} | ||
|
||
public struct StarknetComputationResources: StarknetResources { | ||
public let steps: Int | ||
public let memoryHoles: Int? | ||
public let rangeCheckApplications: Int? | ||
public let pedersenApplications: Int? | ||
public let poseidonApplications: Int? | ||
public let ecOpApplications: Int? | ||
public let ecdsaApplications: Int? | ||
public let bitwiseApplications: Int? | ||
public let keccakApplications: Int? | ||
public let segmentArena: Int? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case steps | ||
case memoryHoles = "memory_holes" | ||
case rangeCheckApplications = "range_check_builtin_applications" | ||
case pedersenApplications = "pedersen_builtin_applications" | ||
case poseidonApplications = "poseidon_builtin_applications" | ||
case ecOpApplications = "ec_op_builtin_applications" | ||
case ecdsaApplications = "ecdsa_builtin_applications" | ||
case bitwiseApplications = "bitwise_builtin_applications" | ||
case keccakApplications = "keccak_builtin_applications" | ||
case segmentArena = "segment_arena_builtin" | ||
} | ||
var l1Gas: Int { get } | ||
var l2Gas: Int { get } | ||
} | ||
|
||
public struct StarknetExecutionResources: StarknetResources { | ||
public let steps: Int | ||
public let memoryHoles: Int? | ||
public let rangeCheckApplications: Int? | ||
public let pedersenApplications: Int? | ||
public let poseidonApplications: Int? | ||
public let ecOpApplications: Int? | ||
public let ecdsaApplications: Int? | ||
public let bitwiseApplications: Int? | ||
public let keccakApplications: Int? | ||
public let segmentArena: Int? | ||
public let dataAvailability: StarknetDataAvailability | ||
public let l1Gas: Int | ||
public let l1DataGas: Int | ||
public let l2Gas: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case steps | ||
case memoryHoles = "memory_holes" | ||
case rangeCheckApplications = "range_check_builtin_applications" | ||
case pedersenApplications = "pedersen_builtin_applications" | ||
case poseidonApplications = "poseidon_builtin_applications" | ||
case ecOpApplications = "ec_op_builtin_applications" | ||
case ecdsaApplications = "ecdsa_builtin_applications" | ||
case bitwiseApplications = "bitwise_builtin_applications" | ||
case keccakApplications = "keccak_builtin_applications" | ||
case segmentArena = "segment_arena_builtin" | ||
case dataAvailability = "data_availability" | ||
case l1Gas = "l1_gas" | ||
case l1DataGas = "l1_data_gas" | ||
case l2Gas = "l2_gas" | ||
} | ||
} | ||
|
||
public struct StarknetDataAvailability: Decodable, Equatable { | ||
public struct StarknetInnerCallExecutionResources: StarknetResources { | ||
public let l1Gas: Int | ||
public let l1DataGas: Int | ||
public let l2Gas: Int | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case l1Gas = "l1_gas" | ||
case l1DataGas = "l1_data_gas" | ||
case l2Gas = "l2_gas" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.