Refactor mapping of curated options from meta.
This commit is contained in:
@@ -260,8 +260,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="119"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:119</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="143"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:143</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -341,8 +341,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="139"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:139</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="163"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:163</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -646,8 +646,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="134"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:134</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="158"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:158</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -687,8 +687,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="94"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:94</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="110"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:110</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -847,8 +847,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="146"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:146</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="170"
|
||||
class="link-to-prism">src/app/_services/transaction.service.ts:170</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1173,30 +1173,46 @@ export class TransactionService {
|
||||
transaction.value = Number(transaction.value);
|
||||
transaction.type = 'transaction';
|
||||
try {
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(transaction.from))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
transaction.sender = this.getAccountInfo(res, cacheSize);
|
||||
},
|
||||
(error) => {
|
||||
transaction.sender = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
}
|
||||
);
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(transaction.to))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
transaction.recipient = this.getAccountInfo(res, cacheSize);
|
||||
},
|
||||
(error) => {
|
||||
transaction.recipient = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
}
|
||||
);
|
||||
if (transaction.from === environment.trustedDeclaratorAddress) {
|
||||
transaction.sender = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
} else {
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(transaction.from))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
transaction.sender = this.getAccountInfo(res, cacheSize);
|
||||
},
|
||||
(error) => {
|
||||
this.loggingService.sendErrorLevelMessage(
|
||||
`Account with address ${transaction.from} not found`,
|
||||
this,
|
||||
{ error }
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
if (transaction.to === environment.trustedDeclaratorAddress) {
|
||||
transaction.recipient = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
} else {
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(transaction.to))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
transaction.recipient = this.getAccountInfo(res, cacheSize);
|
||||
},
|
||||
(error) => {
|
||||
this.loggingService.sendErrorLevelMessage(
|
||||
`Account with address ${transaction.to} not found`,
|
||||
this,
|
||||
{ error }
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
this.addTransaction(transaction, cacheSize);
|
||||
}
|
||||
@@ -1210,18 +1226,26 @@ export class TransactionService {
|
||||
conversion.fromValue = Number(conversion.fromValue);
|
||||
conversion.toValue = Number(conversion.toValue);
|
||||
try {
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(conversion.trader))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
conversion.sender = conversion.recipient = this.getAccountInfo(res);
|
||||
},
|
||||
(error) => {
|
||||
conversion.sender = conversion.recipient = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
}
|
||||
);
|
||||
if (conversion.trader === environment.trustedDeclaratorAddress) {
|
||||
conversion.sender = conversion.recipient = defaultAccount;
|
||||
this.userService.addAccount(defaultAccount, cacheSize);
|
||||
} else {
|
||||
this.userService
|
||||
.getAccountDetailsFromMeta(await User.toKey(conversion.trader))
|
||||
.pipe(first())
|
||||
.subscribe(
|
||||
(res) => {
|
||||
conversion.sender = conversion.recipient = this.getAccountInfo(res);
|
||||
},
|
||||
(error) => {
|
||||
this.loggingService.sendErrorLevelMessage(
|
||||
`Account with address ${conversion.trader} not found`,
|
||||
this,
|
||||
{ error }
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
this.addTransaction(conversion, cacheSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user