Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Commit 8d2a5ab

Browse files
authored
cakeshop 0.10.0 (#42)
v0.10.0 WIP -> master
1 parent 17bb810 commit 8d2a5ab

File tree

157 files changed

+8584
-2077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+8584
-2077
lines changed

bin/multinodes.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
CURRENT=`pwd`
4+
GETH_NODE_PORT=30303
5+
GETH_HTTP_PORT=8102
6+
CONSTELLATION_PORT=9000
7+
CAKESHOP_PORT=8080
8+
NODES=("node1" "node2" "node3" "node4")
9+
10+
11+
case "$1" in
12+
start)
13+
for i in "${NODES[@]}"
14+
do :
15+
mkdir -p "$CURRENT/$i"
16+
cp -n cakeshop.war "$CURRENT/$i"
17+
cd "$CURRENT/$i"
18+
nohup java -Dserver.port=$CAKESHOP_PORT -Dgeth.url=http://localhost:$GETH_HTTP_PORT -Dgeth.node.port=$GETH_NODE_PORT -Dgeth.constellaiton.url=http://127.0.0.1:$CONSTELLATION_PORT -jar cakeshop.war &>/dev/null &
19+
sleep 5
20+
GETH_HTTP_PORT=$(( GETH_HTTP_PORT+1 ))
21+
GETH_NODE_PORT=$(( GETH_NODE_PORT+1 ))
22+
CONSTELLATION_PORT=$(( CONSTELLATION_PORT+1 ))
23+
CAKESHOP_PORT=$(( CAKESHOP_PORT+1 ))
24+
cd ../
25+
done
26+
;;
27+
28+
stop)
29+
killall constellation-node
30+
killall java
31+
;;
32+
33+
esac

cakeshop-abi/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.jpmorgan</groupId>
88
<artifactId>cakeshop-parent</artifactId>
9-
<version>0.9.1</version>
9+
<version>0.10.0</version>
1010
</parent>
1111

1212
<artifactId>cakeshop-abi</artifactId>

cakeshop-abi/src/main/java/com/jpmorgan/cakeshop/model/ContractABI.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ public Constructor getConstructor() {
7878
@Override
7979
public boolean evaluate(Constructor obj) {
8080
return true;
81-
};
82-
});
81+
}
82+
;
83+
}
84+
85+
);
8386
}
8487

8588
public Function findFunction(Predicate<Function> searchPredicate) {
@@ -104,7 +107,6 @@ public String toString() {
104107
return toJson();
105108
}
106109

107-
108110
@JsonInclude(Include.NON_NULL)
109111
public static abstract class Entry {
110112

@@ -116,6 +118,7 @@ public enum Type {
116118

117119
@JsonInclude(Include.NON_NULL)
118120
public static class Param {
121+
119122
public Boolean indexed;
120123
public String name;
121124
public SolidityType type;
@@ -203,18 +206,21 @@ public SolidityType getType() {
203206
public final List<Param> inputs;
204207
public final List<Param> outputs;
205208
public final Type type;
209+
public final Boolean payable;
206210

207-
public Entry(Boolean anonymous, Boolean constant, String name, List<Param> inputs, List<Param> outputs, Type type) {
211+
public Entry(Boolean anonymous, Boolean constant, String name, List<Param> inputs, List<Param> outputs, Type type, Boolean payable) {
208212
this.anonymous = anonymous;
209213
this.constant = constant;
210214
this.name = name;
211215
this.inputs = inputs;
212216
this.outputs = outputs;
213217
this.type = type;
218+
this.payable = payable == null ? Boolean.FALSE : payable;
214219
}
215220

216221
/**
217222
* Signature of this entry, before hashing, e.g., "myfunc(uint,bytes32)"
223+
*
218224
* @return
219225
*/
220226
public String formatSignature() {
@@ -246,11 +252,11 @@ public byte[] encodeSignature() {
246252

247253
@JsonCreator
248254
public static Entry create(@JsonProperty("anonymous") boolean anonymous,
249-
@JsonProperty("constant") boolean constant,
250-
@JsonProperty("name") String name,
251-
@JsonProperty("inputs") List<Param> inputs,
252-
@JsonProperty("outputs") List<Param> outputs,
253-
@JsonProperty("type") Type type) {
255+
@JsonProperty("constant") boolean constant,
256+
@JsonProperty("name") String name,
257+
@JsonProperty("inputs") List<Param> inputs,
258+
@JsonProperty("outputs") List<Param> outputs,
259+
@JsonProperty("type") Type type) {
254260
Entry result = null;
255261
switch (type) {
256262
case constructor:
@@ -295,7 +301,7 @@ public Type getType() {
295301
public static class Constructor extends Entry {
296302

297303
public Constructor(List<Param> inputs, List<Param> outputs) {
298-
super(null, null, "", inputs, outputs, Type.constructor);
304+
super(null, null, "", inputs, outputs, Type.constructor, false);
299305
}
300306

301307
public List<?> decode(byte[] encoded) {
@@ -316,7 +322,7 @@ public static class Function extends Entry {
316322
private static final int ENCODED_SIGN_LENGTH = 4;
317323

318324
public Function(boolean constant, String name, List<Param> inputs, List<Param> outputs) {
319-
super(null, constant, name, inputs, outputs, Type.function);
325+
super(null, constant, name, inputs, outputs, Type.function, false);
320326
}
321327

322328
public String encodeAsHex(Object... args) {
@@ -373,7 +379,7 @@ public String toString() {
373379
public static class Event extends Entry {
374380

375381
public Event(boolean anonymous, String name, List<Param> inputs, List<Param> outputs) {
376-
super(anonymous, null, name, inputs, outputs, Type.event);
382+
super(anonymous, null, name, inputs, outputs, Type.event, false);
377383
}
378384

379385
public List<?> decode(byte[] data, byte[][] topics) {

0 commit comments

Comments
 (0)