Skip to content

Commit

Permalink
Merge pull request #131 from proximax-storage/bug/130-deadlinebackport
Browse files Browse the repository at this point in the history
issue #130 - remove use of DeadlineBP
  • Loading branch information
tonowie authored Nov 12, 2019
2 parents bfb724d + 06aa9e0 commit 2417a75
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public TransferTransaction apply(JsonObject input) {
// retrieve transaction data from transaction field
JsonObject transaction = input.getAsJsonObject("transaction");
// deadline
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
// mosaics
List<Mosaic> mosaics;
if (transaction.getAsJsonArray("mosaics") != null) {
Expand Down Expand Up @@ -212,7 +212,7 @@ public ModifyMetadataTransaction apply(JsonObject input) {
// retrieve transaction data from transaction field
JsonObject transaction = input.getAsJsonObject("transaction");
// deadline
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
// version
JsonElement version = transaction.get("version");
// transaction type
Expand Down Expand Up @@ -283,7 +283,7 @@ public ModifyAccountPropertyTransaction<?> apply(JsonObject input) {
// retrieve transaction data from transaction field
JsonObject transaction = input.getAsJsonObject("transaction");
// deadline
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
// version
JsonElement version = transaction.get("version");
// transaction type
Expand Down Expand Up @@ -382,7 +382,7 @@ public RegisterNamespaceTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));
JsonObject transaction = input.getAsJsonObject("transaction");
// retrieve fields
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NamespaceType namespaceType = NamespaceType.rawValueOf(transaction.get("namespaceType").getAsInt());
NamespaceId namespaceId = new NamespaceId(GsonUtils.getBigInteger(transaction.getAsJsonArray("namespaceId")));
Optional<BigInteger> namespaceDuration = namespaceType == NamespaceType.ROOT_NAMESPACE
Expand Down Expand Up @@ -412,7 +412,7 @@ public MosaicDefinitionTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));
JsonObject transaction = input.getAsJsonObject("transaction");
// load data fields
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
// construct properties
JsonElement version = transaction.get("version");
// return instance of mosaic definition transaction
Expand Down Expand Up @@ -477,7 +477,7 @@ public AliasTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));
JsonObject transaction = input.getAsJsonObject("transaction");
// load data fields
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
JsonElement version = transaction.get("version");
// return instance of mosaic alias definition transaction
return new AliasTransaction(EntityType.MOSAIC_ALIAS, extractNetworkType(version),
Expand All @@ -502,7 +502,7 @@ public AliasTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));
JsonObject transaction = input.getAsJsonObject("transaction");
// load data fields
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
JsonElement version = transaction.get("version");
// return instance of mosaic alias definition transaction
return new AliasTransaction(EntityType.ADDRESS_ALIAS, extractNetworkType(version),
Expand All @@ -523,7 +523,7 @@ public MosaicSupplyChangeTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));

return new MosaicSupplyChangeTransaction(extractNetworkType(transaction.get("version")),
extractTransactionVersion(transaction.get("version")), deadline, extractFee(transaction),
Expand All @@ -543,7 +543,7 @@ public ModifyMultisigAccountTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));

List<MultisigCosignatoryModification> modifications = transaction.has("modifications")
Expand Down Expand Up @@ -575,7 +575,7 @@ public ModifyContractTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));

return new ModifyContractTransaction(networkType, extractTransactionVersion(transaction.get("version")), deadline,
Expand Down Expand Up @@ -619,7 +619,7 @@ public AggregateTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));

List<Transaction> transactions = new ArrayList<>();
Expand Down Expand Up @@ -680,7 +680,7 @@ public LockFundsTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));
Mosaic mosaic;
if (transaction.has("mosaicId")) {
Expand Down Expand Up @@ -711,7 +711,7 @@ public SecretLockTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));
Mosaic mosaic;
if (transaction.has("mosaicId")) {
Expand All @@ -738,7 +738,7 @@ public SecretProofTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));

return new SecretProofTransaction(networkType, extractTransactionVersion(transaction.get("version")), deadline,
Expand All @@ -761,7 +761,7 @@ public AccountLinkTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));
return new AccountLinkTransaction(
networkType,
Expand Down Expand Up @@ -800,7 +800,7 @@ public BlockchainUpgradeTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));
return new BlockchainUpgradeTransaction(
networkType,
Expand All @@ -825,7 +825,7 @@ public BlockchainConfigTransaction apply(JsonObject input) {
TransactionInfo transactionInfo = this.createTransactionInfo(input.getAsJsonObject("meta"));

JsonObject transaction = input.getAsJsonObject("transaction");
DeadlineBP deadline = new DeadlineBP(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
DeadlineRaw deadline = new DeadlineRaw(GsonUtils.getBigInteger(transaction.getAsJsonArray("deadline")));
NetworkType networkType = extractNetworkType(transaction.get("version"));
return new BlockchainConfigTransaction(
networkType,
Expand Down

0 comments on commit 2417a75

Please sign in to comment.