Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions src/infrastructure/TransactionHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {PublicAccount} from '../model/account/PublicAccount';
import {CosignatureSignedTransaction} from '../model/transaction/CosignatureSignedTransaction';
import {Deadline} from '../model/transaction/Deadline';
import {SignedTransaction} from '../model/transaction/SignedTransaction';
import { SyncAnnounce } from '../model/transaction/SyncAnnounce';
import {Transaction} from '../model/transaction/Transaction';
import {TransactionAnnounceResponse} from '../model/transaction/TransactionAnnounceResponse';
import {TransactionStatus} from '../model/transaction/TransactionStatus';
Expand Down Expand Up @@ -93,7 +94,7 @@ export class TransactionHttp extends Http implements TransactionRepository {
transactionStatusDTO.status,
transactionStatusDTO.hash,
Deadline.createFromDTO(transactionStatusDTO.deadline),
new UInt64(transactionStatusDTO.height));
transactionStatusDTO.height ? new UInt64(transactionStatusDTO.height) : UInt64.fromUint(0));
}));
}

Expand All @@ -115,7 +116,7 @@ export class TransactionHttp extends Http implements TransactionRepository {
transactionStatusDTO.status,
transactionStatusDTO.hash,
Deadline.createFromDTO(transactionStatusDTO.deadline),
new UInt64(transactionStatusDTO.height));
transactionStatusDTO.height ? new UInt64(transactionStatusDTO.height) : UInt64.fromUint(0));
});
}));
}
Expand Down Expand Up @@ -182,27 +183,11 @@ export class TransactionHttp extends Http implements TransactionRepository {
} else {
return CreateTransactionFromDTO(response);
}
}),catchError((err) => {
}), catchError((err) => {
if (err.statusCode === 405) {
return observableThrowError('non sync server');
}
return observableThrowError(err);
}),);
}
}

class SyncAnnounce {
constructor(/**
* Transaction serialized data
*/
public readonly payload: string,
/**
* Transaction hash
*/
public readonly hash: string,
/**
* Transaction address
*/
public readonly address: string) {
}));
}
}
1 change: 1 addition & 0 deletions src/model/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export * from './transaction/RegisterNamespaceTransaction';
export * from './transaction/SecretLockTransaction';
export * from './transaction/SecretProofTransaction';
export * from './transaction/SignedTransaction';
export * from './transaction/SyncAnnounce';
export * from './transaction/Transaction';
export * from './transaction/TransactionAnnounceResponse';
export * from './transaction/TransactionInfo';
Expand Down
38 changes: 38 additions & 0 deletions src/model/transaction/SyncAnnounce.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2019 NEM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export class SyncAnnounce {
/**
* @internal
* @param payload
* @param hash
* @param address
*/
constructor(
/**
* Transaction serialized data
*/
public readonly payload: string,
/**
* Transaction hash
*/
public readonly hash: string,
/**
* Transaction address
*/
public readonly address: string) {
}
}
2 changes: 1 addition & 1 deletion test/model/UInt64.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Uint64', () => {
expect(uint64Compact).to.be.equal(51110867862);
});

it('should fromUnit throw exception with negative unit value', () => {
it('should fromUint throw exception with negative uint value', () => {
expect(() => {
UInt64.fromUint(-1);
}).to.throw(Error, 'Unsigned integer cannot be negative');
Expand Down