diff --git a/src/masternodes/masternodes.cpp b/src/masternodes/masternodes.cpp index 11b182a0d5..066b015830 100644 --- a/src/masternodes/masternodes.cpp +++ b/src/masternodes/masternodes.cpp @@ -1185,6 +1185,11 @@ boost::optional CCustomCSView::GetCollat collToken.factor = attributes->GetValue(factorKey, CAmount{0}); collToken.idToken = id; + auto token = GetToken(id); + if (token) { + collToken.creationTx = token->creationTx; + } + return collToken; } } diff --git a/test/functional/feature_loan_setcollateraltoken.py b/test/functional/feature_loan_setcollateraltoken.py index 81389e7bd4..9329eb9e5a 100755 --- a/test/functional/feature_loan_setcollateraltoken.py +++ b/test/functional/feature_loan_setcollateraltoken.py @@ -226,5 +226,15 @@ def run_test(self): assert_equal(result[f'v0/token/{idGOOGL}/loan_collateral_factor'], '0.12345678') assert_equal(result[f'v0/token/{idGOOGL}/fixed_interval_price_id'], 'GOOGL/USD') + # Get token creation TX + token = self.nodes[0].gettoken(idGOOGL)[idGOOGL] + + # Check entry in list collateral tokens + result = self.nodes[0].listcollateraltokens()[2] + assert_equal(result['token'], 'GOOGL') + assert_equal(result['tokenId'], token['creationTx']) + assert_equal(result['factor'], Decimal('0.50000000')) + assert_equal(result['fixedIntervalPriceId'], 'GOOGL/USD') + if __name__ == '__main__': LoanSetCollateralTokenTest().main()