Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DelevoXDG committed Mar 21, 2024
1 parent 58b821e commit 7fb6ebe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Sources/Starknet/Accounts/StarknetAccountProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public protocol StarknetAccountProtocol {

/// Execute list of calls as invoke transaction v3
///
/// Execute list of calls as invoke transaction v1 with automatically estimated fee
/// Execute list of calls as invoke transaction v3 with automatically estimated fee
///
/// - Parameters:
/// - calls: list of calls to be executed.
Expand Down Expand Up @@ -337,7 +337,7 @@ public extension StarknetAccountProtocol {

/// Execute a call as invoke transaction v3
///
/// Execute a call as invoke transaction v1 with automatically estimated fee
/// Execute a call as invoke transaction v3 with automatically estimated fee
///
/// - Parameters:
/// - call: a call to be executed.
Expand Down
10 changes: 5 additions & 5 deletions Sources/Starknet/Crypto/FeeCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public extension StarknetFeeEstimate {
/// Then multiplies `maxAmount` by **round((amountMultiplier) \* 100%)** and `maxPricePerUnit` by **round((unitPriceMultiplier) \* 100%)** and performs integer division by 100 on both.
///
/// - Parameters:
/// - amountMultiplier: Multiplier for max amount, defaults to 1.5.
/// - unitPriceMultiplier: Multiplier for max price per unit, defaults to 1.5.
/// - amountMultiplier: multiplier for max amount, defaults to 1.5.
/// - unitPriceMultiplier: multiplier for max price per unit, defaults to 1.5.
///
/// - Returns: Resource bounds with applied multipliers
/// - Returns: resource bounds with applied multipliers
func toResourceBounds(amountMultiplier: Double = 1.5, unitPriceMultiplier: Double = 1.5) -> StarknetResourceBoundsMapping {
let maxAmount = self.gasPrice == .zero ? UInt64AsHex.zero : (self.overallFee.value / self.gasPrice.value).applyMultiplier(amountMultiplier).toUInt64AsHexClamped()

Expand All @@ -27,9 +27,9 @@ public extension StarknetFeeEstimate {
/// Multiplies `overallFee` by **round(multiplier] \* 100%)** and performs integer division by 100.
///
/// - Parameters:
/// - multiplier: Multiplier for max fee, defaults to 1.5.
/// - multiplier: multiplier for max fee, defaults to 1.5.
///
/// - Returns: Fee with applied multiplier
/// - Returns: fee with applied multiplier
func toMaxFee(multiplier: Double = 1.5) -> Felt {
self.overallFee.value.applyMultiplier(multiplier).toFeltClamped()
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/StarknetTests/Accounts/AccountTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ final class AccountTests: XCTestCase {
try await Self.devnetClient.assertTransactionFailed(transactionHash: result2.transactionHash)
}

func testExecuteV3FeeMultiplier() async throws {
func testExecuteV3FeeMultipliers() async throws {
let recipientAddress = AccountTests.devnetClient.constants.predeployedAccount2.address

let calldata: [Felt] = [recipientAddress, 1000, 0]
Expand Down

0 comments on commit 7fb6ebe

Please sign in to comment.