Skip to content

Commit 540412d

Browse files
committed
throw execption when use transactionHttp.announce to announce aggregate bonded tx
1 parent e157d43 commit 540412d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/infrastructure/TransactionHttp.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ export class TransactionHttp extends Http implements TransactionRepository {
156156
* @returns Observable<TransactionAnnounceResponse>
157157
*/
158158
public announce(signedTransaction: SignedTransaction): Observable<TransactionAnnounceResponse> {
159+
if (signedTransaction.type !== TransactionType.AGGREGATE_BONDED) {
160+
throw new Error('Announcing aggregate bonded transaction should use \'announceAggregateBonded\'');
161+
}
159162
return observableFrom(this.transactionRoutesApi.announceTransaction(signedTransaction)).pipe(
160163
map((response: { response: ClientResponse; body: AnnounceTransactionInfoDTO; } ) => {
161164
const transactionAnnounceResponseDTO = response.body;

0 commit comments

Comments
 (0)