Closed amiecorso closed 4 years ago
Merging #260 into master will decrease coverage by
0.00%
. The diff coverage is95.34%
.
@@ Coverage Diff @@
## master #260 +/- ##
==========================================
- Coverage 90.01% 90.01% -0.01%
==========================================
Files 42 42
Lines 941 951 +10
==========================================
+ Hits 847 856 +9
- Misses 94 95 +1
Impacted Files | Coverage Δ | |
---|---|---|
XpringKit/XRP/DefaultXRPClient.swift | 98.01% <93.75%> (-0.59%) |
:arrow_down: |
XpringKit/XRP/ReliableSubmissionXRPClient.swift | 94.44% <100.00%> (+0.21%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f47a93f...67f2eff. Read the comment docs.
High Level Overview of Change
In preparation to include additional transaction types in the
XRPClient
, this PR refactors the code for preparing and submitting transactions into private reusable helper functions.Specifically,
prepareBaseTransaction
constructs and returns aTransaction
protobuf object that has been populated with the required and recommended common fields (https://xrpl.org/transaction-common-fields.html) necessary for all transaction types.signAndSubmitTransaction
takes a completedTransaction
protobuf object and handles the signing and submitting process.awaitFinalTransactionResult
handles the reliable submission logic of waiting for the transaction to either be included in a validated ledger or pass itslastLedgerSequence
, at which point the result code of the transaction can be considered final.The logic for constructing and submitting an arbitrary transaction type would now be:
Transaction
usingprepareBaseTransaction
Payment
) and assign to theTransaction
object (https://xrpl.org/transaction-types.html), as well as any desired, optional common fields such as memos.signAndSubmitTransaction
awaitFinalTransactionResult
Context of Change
Type of Change
Before / After
Common transaction submission steps are now reusable.
Test Plan
CI still passes