Skip to content

Commit

Permalink
No (almost) limit for details value (#29)
Browse files Browse the repository at this point in the history
* No (almost) limit for details value

Signed-off-by: Mingela <[email protected]>

* fixed validator test

Signed-off-by: Mingela <[email protected]>
  • Loading branch information
Mingela authored and Warchant committed May 22, 2019
1 parent 3093b09 commit 83a8c45
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions client/src/main/java/jp/co/soramitsu/iroha/java/IrohaAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,30 @@ public IrohaAPI(ManagedChannel channel) {
}

public IrohaAPI setChannelForBlockingCmdStub(Channel channel) {
cmdStub = CommandService_v1Grpc.newBlockingStub(channel);
cmdStub = CommandService_v1Grpc.newBlockingStub(channel)
.withMaxInboundMessageSize(Integer.MAX_VALUE)
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
return this;
}

public IrohaAPI setChannelForStreamingCmdStub(Channel channel) {
cmdStreamingStub = CommandService_v1Grpc.newStub(channel);
cmdStreamingStub = CommandService_v1Grpc.newStub(channel)
.withMaxInboundMessageSize(Integer.MAX_VALUE)
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
return this;
}

public IrohaAPI setChannelForBlockingQueryStub(Channel channel) {
queryStub = QueryService_v1Grpc.newBlockingStub(channel);
queryStub = QueryService_v1Grpc.newBlockingStub(channel)
.withMaxInboundMessageSize(Integer.MAX_VALUE)
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
return this;
}

public IrohaAPI setChannelForStreamingQueryStub(Channel channel) {
queryStreamingStub = QueryService_v1Grpc.newStub(channel);
queryStreamingStub = QueryService_v1Grpc.newStub(channel)
.withMaxInboundMessageSize(Integer.MAX_VALUE)
.withMaxOutboundMessageSize(Integer.MAX_VALUE);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Const {
public static final String assetIdDelimiter = "#";
public static final String accountIdDelimiter = "@";
public static final String hostPortDelimiter = ":";
public static final int accountDetailsMaxLength = 4096;
public static final int accountDetailsMaxLength = 4194304;

public static final Pattern accountDetailsKeyPattern = Pattern.compile("[A-Za-z0-9_]{1,64}");
public static final Pattern accountPattern = Pattern.compile("[a-z_0-9]{1,32}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class FieldValidatorTest extends Specification {
PRECISION | 300 // too big
ROLE_NAME | "" // empty role name
DETAILS_KEY | "" // empty key
DETAILS_VALUE | "1" * 6000 // too big
DETAILS_VALUE | "1" * 6000000 // too big
TIMESTAMP | -5 // can't be negative
DOMAIN | "" // empty
DOMAIN | "bogdan!com" // invalid domain
Expand Down

0 comments on commit 83a8c45

Please sign in to comment.