Skip to content

Commit

Permalink
fix: prevent unnecessary calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
bigearsenal committed Jan 24, 2024
1 parent 69d8871 commit 4cf5ff7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Packages/KeyAppKit/Sources/Send/Input/SendInputState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ public struct SendInputState: Equatable {

public extension SendInputState {
var totalAmount: UInt64 {
// assertion to prevent unneccessary calculation that can lead to slightly different results
if isSendingMaxAmount {
return token.lamports
}

var totalAmount: UInt64 = 0

// get receivingAmount
Expand Down

0 comments on commit 4cf5ff7

Please sign in to comment.