Skip to content

Commit

Permalink
Lower PRESET default deposit guarantee to 99% (from 100%), for NEW Pr… (
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Mar 15, 2024
1 parent 6efcea2 commit fe5490d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ extension AppPreferences {
CustomStringConvertible,
CustomDumpReflectable
{
public static let defaultDepositGuaranteePreset = RETDecimal(floatLiteral: 0.99)
public var defaultDepositGuarantee: RETDecimal

public init(
defaultDepositGuarantee: RETDecimal = 1
defaultDepositGuarantee: RETDecimal = Self.defaultDepositGuaranteePreset
) {
self.defaultDepositGuarantee = defaultDepositGuarantee
}
Expand Down
11 changes: 11 additions & 0 deletions RadixWalletTests/ProfileTests/TestCases/ProfileBuilderTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import Foundation
import XCTest

final class ProfileBuilderTest: TestCase {
// MOVE ME to some appropriate file.
func test_tx_guarantee_default_preset_is_99() throws {
let expectedPreset = try RETDecimal(value: "0.99")
XCTAssertEqual(AppPreferences.Transaction.defaultDepositGuaranteePreset, expectedPreset)
XCTAssertEqual(AppPreferences.Transaction().defaultDepositGuarantee, expectedPreset)
XCTAssertEqual(AppPreferences().transaction.defaultDepositGuarantee, expectedPreset)

// assert the initializer of Transaction still uses the passed in value...
XCTAssertEqual(AppPreferences.Transaction(defaultDepositGuarantee: 2).defaultDepositGuarantee, 2)
}

func test_profile_builder() throws {
let profile = ProfileBuilder()
.bdfs()
Expand Down

0 comments on commit fe5490d

Please sign in to comment.