From d2aa45c1890d9ec648a841983be18cf4e1b3d58e Mon Sep 17 00:00:00 2001 From: Anton Wiedermann Date: Sat, 29 Feb 2020 22:42:58 +0100 Subject: [PATCH 1/4] issue #141 - version field changed to long (int64) --- schemas/swagger/swagger.yaml | 1 + .../io/proximax/sdk/gen/model/BlockDTO.java | 22 +++++-------------- .../sdk/model/blockchain/BlockInfoTest.java | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/schemas/swagger/swagger.yaml b/schemas/swagger/swagger.yaml index bed18bfa..f6de040b 100644 --- a/schemas/swagger/swagger.yaml +++ b/schemas/swagger/swagger.yaml @@ -1733,6 +1733,7 @@ components: * 0xF243 (62019 decimal) - Mosaic_Alias_Resolution. NetworkTypeEnum: type: integer + format: int64 description: | The entity version. The higher byte represents the network identifier: diff --git a/src/gen/java/io/proximax/sdk/gen/model/BlockDTO.java b/src/gen/java/io/proximax/sdk/gen/model/BlockDTO.java index aa2a5c91..3e752f03 100644 --- a/src/gen/java/io/proximax/sdk/gen/model/BlockDTO.java +++ b/src/gen/java/io/proximax/sdk/gen/model/BlockDTO.java @@ -14,20 +14,10 @@ package io.proximax.sdk.gen.model; import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; + import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.proximax.sdk.gen.model.BlockDTOAllOf; -import io.proximax.sdk.gen.model.EntityDTO; -import io.proximax.sdk.gen.model.EntityTypeEnum; -import io.proximax.sdk.gen.model.UInt64DTO; -import io.proximax.sdk.gen.model.VerifiableEntityDTO; -import io.swagger.annotations.ApiModel; + import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; /** * BlockDTO @@ -44,7 +34,7 @@ public class BlockDTO { public static final String SERIALIZED_NAME_VERSION = "version"; @SerializedName(SERIALIZED_NAME_VERSION) - private Integer version; + private Long version; public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) @@ -130,7 +120,7 @@ public void setSigner(String signer) { this.signer = signer; } - public BlockDTO version(Integer version) { + public BlockDTO version(Long version) { this.version = version; return this; } @@ -140,11 +130,11 @@ public BlockDTO version(Integer version) { * @return version **/ @ApiModelProperty(example = "36867", required = true, value = "The entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. ") - public Integer getVersion() { + public Long getVersion() { return version; } - public void setVersion(Integer version) { + public void setVersion(Long version) { this.version = version; } diff --git a/src/test/java/io/proximax/sdk/model/blockchain/BlockInfoTest.java b/src/test/java/io/proximax/sdk/model/blockchain/BlockInfoTest.java index 2576fd22..34a0a6ec 100644 --- a/src/test/java/io/proximax/sdk/model/blockchain/BlockInfoTest.java +++ b/src/test/java/io/proximax/sdk/model/blockchain/BlockInfoTest.java @@ -84,7 +84,7 @@ void createANewBlockInforomDto() { BlockDTO blockDto = new BlockDTO(); blockDto.setSignature("37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868E932E1A9BEF8A27D48E1FFEE401E933EB801824373E7537E51733E0F"); blockDto.setSigner("B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF"); - blockDto.setVersion(36867); + blockDto.setVersion(36867l); blockDto.setType(EntityTypeEnum.NUMBER_16705); blockDto.setHeight(getUint64Dto(2)); blockDto.setTimestamp(getUint64Dto(3)); From 3b65186a2c0b276607b106fbb7e19ef52ca50884 Mon Sep 17 00:00:00 2001 From: Anton Wiedermann Date: Sat, 29 Feb 2020 23:00:45 +0100 Subject: [PATCH 2/4] load transaction test now does not make assumption about height previously chain with less than 1000 blocks failed, now the test is flexible --- src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java b/src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java index 00d40115..9f38c4a1 100644 --- a/src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java +++ b/src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java @@ -187,12 +187,19 @@ void checkBlockchainUpgrade() { @Test void loadTransactions() { - for (int i = 0; i<1000; i++) { + // get chain height + final long height = blockchainHttp.getBlockchainHeight().blockingFirst().longValue(); + // go over first 50 blocks + for (int i = 0; i transactions = blockchainHttp.getBlockTransactions(BigInteger.valueOf(block), new QueryParams(100)).blockingFirst(); assertTrue(transactions.size() <= 100); From 4e39034eb07e8cbfdadf0202d378f0b467263c6f Mon Sep 17 00:00:00 2001 From: Anton Wiedermann Date: Sat, 29 Feb 2020 23:04:56 +0100 Subject: [PATCH 3/4] fixing readme which was broken by rogue pull-request in the past I have rejected pullrequest which was suggesting incorrect change to readme but it was merged to master anyway. So taking this opportunity to fix it --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa80f433..1fbe9efa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

ProximaX Sirius Blockchain Java SDK

+

ProximaX Sirius Blockchain Java SDK

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Coverage Status](https://coveralls.io/repos/github/proximax-storage/java-xpx-chain-sdk/badge.svg?branch=master)](https://coveralls.io/github/proximax-storage/java-xpx-chain-sdk?branch=master) From 4158c1ed7ba8ed56ff8b6b90dba53473eb5f79c9 Mon Sep 17 00:00:00 2001 From: Anton Wiedermann Date: Sat, 29 Feb 2020 23:06:58 +0100 Subject: [PATCH 4/4] issue #141 - changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a73ef25b..64b38652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Minor release with new features and fixes * added MosaicFactory to better support frequent mosaic instantiation and non-standard network currencies * added support for exchange transactions +* added support for unsigned version field for entity info on the chain ## 0.6.1