Skip to content

Commit 83a8c45

Browse files
MingelaWarchant
authored andcommitted
No (almost) limit for details value (#29)
* No (almost) limit for details value Signed-off-by: Mingela <[email protected]> * fixed validator test Signed-off-by: Mingela <[email protected]>
1 parent 3093b09 commit 83a8c45

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

client/src/main/java/jp/co/soramitsu/iroha/java/IrohaAPI.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,30 @@ public IrohaAPI(ManagedChannel channel) {
7474
}
7575

7676
public IrohaAPI setChannelForBlockingCmdStub(Channel channel) {
77-
cmdStub = CommandService_v1Grpc.newBlockingStub(channel);
77+
cmdStub = CommandService_v1Grpc.newBlockingStub(channel)
78+
.withMaxInboundMessageSize(Integer.MAX_VALUE)
79+
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
7880
return this;
7981
}
8082

8183
public IrohaAPI setChannelForStreamingCmdStub(Channel channel) {
82-
cmdStreamingStub = CommandService_v1Grpc.newStub(channel);
84+
cmdStreamingStub = CommandService_v1Grpc.newStub(channel)
85+
.withMaxInboundMessageSize(Integer.MAX_VALUE)
86+
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
8387
return this;
8488
}
8589

8690
public IrohaAPI setChannelForBlockingQueryStub(Channel channel) {
87-
queryStub = QueryService_v1Grpc.newBlockingStub(channel);
91+
queryStub = QueryService_v1Grpc.newBlockingStub(channel)
92+
.withMaxInboundMessageSize(Integer.MAX_VALUE)
93+
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
8894
return this;
8995
}
9096

9197
public IrohaAPI setChannelForStreamingQueryStub(Channel channel) {
92-
queryStreamingStub = QueryService_v1Grpc.newStub(channel);
98+
queryStreamingStub = QueryService_v1Grpc.newStub(channel)
99+
.withMaxInboundMessageSize(Integer.MAX_VALUE)
100+
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
93101
return this;
94102
}
95103

client/src/main/java/jp/co/soramitsu/iroha/java/detail/Const.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class Const {
77
public static final String assetIdDelimiter = "#";
88
public static final String accountIdDelimiter = "@";
99
public static final String hostPortDelimiter = ":";
10-
public static final int accountDetailsMaxLength = 4096;
10+
public static final int accountDetailsMaxLength = 4194304;
1111

1212
public static final Pattern accountDetailsKeyPattern = Pattern.compile("[A-Za-z0-9_]{1,64}");
1313
public static final Pattern accountPattern = Pattern.compile("[a-z_0-9]{1,32}");

client/src/test/groovy/jp/co/soramitsu/iroha/java/FieldValidatorTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class FieldValidatorTest extends Specification {
133133
PRECISION | 300 // too big
134134
ROLE_NAME | "" // empty role name
135135
DETAILS_KEY | "" // empty key
136-
DETAILS_VALUE | "1" * 6000 // too big
136+
DETAILS_VALUE | "1" * 6000000 // too big
137137
TIMESTAMP | -5 // can't be negative
138138
DOMAIN | "" // empty
139139
DOMAIN | "bogdan!com" // invalid domain

0 commit comments

Comments
 (0)