-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from strategyobject/feature/rpc-contracts
Rpc contracts
- Loading branch information
Showing
56 changed files
with
612 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
dependencies { | ||
implementation 'org.reflections:reflections:0.10.1' | ||
implementation 'org.reflections:reflections:0.10.2' | ||
implementation 'com.squareup:javapoet:1.13.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
dependencies { | ||
implementation project(':common') | ||
implementation project(':scale') | ||
implementation project(':transport') | ||
|
||
testImplementation 'com.google.code.gson:gson:2.8.8' | ||
testImplementation 'com.google.code.gson:gson:2.8.9' | ||
} |
4 changes: 3 additions & 1 deletion
4
rpc/rpc-core/src/main/java/com/strategyobject/substrateclient/rpc/core/RpcDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...re/src/main/java/com/strategyobject/substrateclient/rpc/core/decoders/BooleanDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.strategyobject.substrateclient.rpc.core.decoders; | ||
|
||
import com.strategyobject.substrateclient.rpc.core.DecoderPair; | ||
import com.strategyobject.substrateclient.transport.RpcObject; | ||
|
||
public class BooleanDecoder extends AbstractDecoder<Boolean> { | ||
@Override | ||
protected Boolean decodeNonNull(Object value, DecoderPair<?>[] decoders) { | ||
return (Boolean) value; | ||
protected Boolean decodeNonNull(RpcObject value, DecoderPair<?>[] decoders) { | ||
return value.asBoolean(); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...-core/src/main/java/com/strategyobject/substrateclient/rpc/core/decoders/ByteDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.strategyobject.substrateclient.rpc.core.decoders; | ||
|
||
import com.strategyobject.substrateclient.rpc.core.DecoderPair; | ||
import com.strategyobject.substrateclient.transport.RpcObject; | ||
|
||
public class ByteDecoder extends AbstractDecoder<Byte> { | ||
@Override | ||
protected Byte decodeNonNull(Object value, DecoderPair<?>[] decoders) { | ||
return ((Double) value).byteValue(); | ||
protected Byte decodeNonNull(RpcObject value, DecoderPair<?>[] decoders) { | ||
return value.asNumber().byteValue(); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...ore/src/main/java/com/strategyobject/substrateclient/rpc/core/decoders/DoubleDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.strategyobject.substrateclient.rpc.core.decoders; | ||
|
||
import com.strategyobject.substrateclient.rpc.core.DecoderPair; | ||
import com.strategyobject.substrateclient.transport.RpcObject; | ||
|
||
public class DoubleDecoder extends AbstractDecoder<Double> { | ||
@Override | ||
protected Double decodeNonNull(Object value, DecoderPair<?>[] decoders) { | ||
return (Double) value; | ||
protected Double decodeNonNull(RpcObject value, DecoderPair<?>[] decoders) { | ||
return value.asNumber().doubleValue(); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...core/src/main/java/com/strategyobject/substrateclient/rpc/core/decoders/FloatDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.strategyobject.substrateclient.rpc.core.decoders; | ||
|
||
import com.strategyobject.substrateclient.rpc.core.DecoderPair; | ||
import com.strategyobject.substrateclient.transport.RpcObject; | ||
|
||
public class FloatDecoder extends AbstractDecoder<Float> { | ||
@Override | ||
protected Float decodeNonNull(Object value, DecoderPair<?>[] decoders) { | ||
return ((Double) value).floatValue(); | ||
protected Float decodeNonNull(RpcObject value, DecoderPair<?>[] decoders) { | ||
return value.asNumber().floatValue(); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
...c-core/src/main/java/com/strategyobject/substrateclient/rpc/core/decoders/IntDecoder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package com.strategyobject.substrateclient.rpc.core.decoders; | ||
|
||
import com.strategyobject.substrateclient.rpc.core.DecoderPair; | ||
import com.strategyobject.substrateclient.transport.RpcObject; | ||
|
||
public class IntDecoder extends AbstractDecoder<Integer> { | ||
@Override | ||
protected Integer decodeNonNull(Object value, DecoderPair<?>[] decoders) { | ||
return ((Double) value).intValue(); | ||
protected Integer decodeNonNull(RpcObject value, DecoderPair<?>[] decoders) { | ||
return value.asNumber().intValue(); | ||
} | ||
} |
Oops, something went wrong.