This repository has been archived by the owner on Jun 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 719
Add new line with wallet name on Transaction Confirmation #866
Merged
vikmeup
merged 13 commits into
master
from
feature/862-wallet-name-on-confirm-transaction
Aug 3, 2018
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1c2f273
Add new line with wallet name on Transaction Confirmation
taraspasichnyk 3177511
Changge wallet info used for currentWalletTitle to improve clarity.
taraspasichnyk 120024d
Change visual appearance of sender wallet view.
taraspasichnyk 38e8f05
Merge branch 'master' into feature/862-wallet-name-on-confirm-transac…
taraspasichnyk a7472fe
Change title From Wallet -> From. Avoid passing Keystore.
taraspasichnyk a486862
Use localizable string instead
taraspasichnyk 2979f4f
Remove useless localized string
taraspasichnyk fa7a02d
Change Sender -> From
taraspasichnyk 025e6ab
Remove variables, combined in other string variable.
taraspasichnyk 630b5cb
Add unit test for format of string in ConfirmPaymentDetailsViewModel
taraspasichnyk c01b524
Add factory to PreviewTransaction
vikmeup 9ca25df
Impove ConfirmPaymentDetailsViewModelTests
vikmeup 9ff1b74
Shorten address
vikmeup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,16 +53,8 @@ struct ConfirmPaymentDetailsViewModel { | |
return transaction.gasLimit | ||
} | ||
|
||
var currentWalletName: String { | ||
return session.account.info.name | ||
} | ||
|
||
var currentWalletAddress: String { | ||
return session.account.address.description | ||
} | ||
|
||
var currentWalletDescriptionString: String { | ||
return currentWalletName + " " + ("(\(currentWalletAddress))") | ||
return session.account.info.name + " " + ("(\(session.account.address.description))") | ||
} | ||
|
||
var paymentFromTitle: String { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should use |
||
|
39 changes: 39 additions & 0 deletions
39
TrustTests/Transfer/ViewModels/ConfirmPaymentDetailsViewModelTests.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright DApps Platform Inc. All rights reserved. | ||
|
||
import XCTest | ||
import Realm | ||
import RealmSwift | ||
import BigInt | ||
@testable import Trust | ||
|
||
class ConfirmPaymentDetailsViewModelTests: XCTestCase { | ||
|
||
func testActionButtonTitleOnSignAndSend() { | ||
let bigInt = BigInt("11274902618710000000000")! | ||
|
||
let transaction = PreviewTransaction( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make factory for |
||
value: bigInt, | ||
account: .make(), | ||
address: .make(), | ||
contract: .make(), | ||
nonce: bigInt, | ||
data: Data(), | ||
gasPrice: bigInt, | ||
gasLimit: bigInt, | ||
transfer: .init(server: .make(), type: .ether(.make(), destination: .none)) | ||
) | ||
|
||
let session = WalletSession.make(realm: .make(), sharedRealm: .make()) | ||
|
||
let viewModel = ConfirmPaymentDetailsViewModel( | ||
transaction: transaction, | ||
session: session, | ||
server: .make() | ||
) | ||
|
||
let description = session.account.info.name + " " + "(\(session.account.address.description))" | ||
|
||
XCTAssertEqual(description, viewModel.currentWalletDescriptionString) | ||
} | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you combine all in one string? no need to create separate variables.
maybe one test case?