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

Commit

Permalink
cakeshop 0.10.0 (#42)
Browse files Browse the repository at this point in the history
v0.10.0 WIP -> master
  • Loading branch information
fixanoid authored Jul 14, 2017
1 parent 17bb810 commit 8d2a5ab
Show file tree
Hide file tree
Showing 157 changed files with 8,584 additions and 2,077 deletions.
33 changes: 33 additions & 0 deletions bin/multinodes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

CURRENT=`pwd`
GETH_NODE_PORT=30303
GETH_HTTP_PORT=8102
CONSTELLATION_PORT=9000
CAKESHOP_PORT=8080
NODES=("node1" "node2" "node3" "node4")


case "$1" in
start)
for i in "${NODES[@]}"
do :
mkdir -p "$CURRENT/$i"
cp -n cakeshop.war "$CURRENT/$i"
cd "$CURRENT/$i"
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 &
sleep 5
GETH_HTTP_PORT=$(( GETH_HTTP_PORT+1 ))
GETH_NODE_PORT=$(( GETH_NODE_PORT+1 ))
CONSTELLATION_PORT=$(( CONSTELLATION_PORT+1 ))
CAKESHOP_PORT=$(( CAKESHOP_PORT+1 ))
cd ../
done
;;

stop)
killall constellation-node
killall java
;;

esac
2 changes: 1 addition & 1 deletion cakeshop-abi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.jpmorgan</groupId>
<artifactId>cakeshop-parent</artifactId>
<version>0.9.1</version>
<version>0.10.0</version>
</parent>

<artifactId>cakeshop-abi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ public Constructor getConstructor() {
@Override
public boolean evaluate(Constructor obj) {
return true;
};
});
}
;
}

);
}

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


@JsonInclude(Include.NON_NULL)
public static abstract class Entry {

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

@JsonInclude(Include.NON_NULL)
public static class Param {

public Boolean indexed;
public String name;
public SolidityType type;
Expand Down Expand Up @@ -203,18 +206,21 @@ public SolidityType getType() {
public final List<Param> inputs;
public final List<Param> outputs;
public final Type type;
public final Boolean payable;

public Entry(Boolean anonymous, Boolean constant, String name, List<Param> inputs, List<Param> outputs, Type type) {
public Entry(Boolean anonymous, Boolean constant, String name, List<Param> inputs, List<Param> outputs, Type type, Boolean payable) {
this.anonymous = anonymous;
this.constant = constant;
this.name = name;
this.inputs = inputs;
this.outputs = outputs;
this.type = type;
this.payable = payable == null ? Boolean.FALSE : payable;
}

/**
* Signature of this entry, before hashing, e.g., "myfunc(uint,bytes32)"
*
* @return
*/
public String formatSignature() {
Expand Down Expand Up @@ -246,11 +252,11 @@ public byte[] encodeSignature() {

@JsonCreator
public static Entry create(@JsonProperty("anonymous") boolean anonymous,
@JsonProperty("constant") boolean constant,
@JsonProperty("name") String name,
@JsonProperty("inputs") List<Param> inputs,
@JsonProperty("outputs") List<Param> outputs,
@JsonProperty("type") Type type) {
@JsonProperty("constant") boolean constant,
@JsonProperty("name") String name,
@JsonProperty("inputs") List<Param> inputs,
@JsonProperty("outputs") List<Param> outputs,
@JsonProperty("type") Type type) {
Entry result = null;
switch (type) {
case constructor:
Expand Down Expand Up @@ -295,7 +301,7 @@ public Type getType() {
public static class Constructor extends Entry {

public Constructor(List<Param> inputs, List<Param> outputs) {
super(null, null, "", inputs, outputs, Type.constructor);
super(null, null, "", inputs, outputs, Type.constructor, false);
}

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

public Function(boolean constant, String name, List<Param> inputs, List<Param> outputs) {
super(null, constant, name, inputs, outputs, Type.function);
super(null, constant, name, inputs, outputs, Type.function, false);
}

public String encodeAsHex(Object... args) {
Expand Down Expand Up @@ -373,7 +379,7 @@ public String toString() {
public static class Event extends Entry {

public Event(boolean anonymous, String name, List<Param> inputs, List<Param> outputs) {
super(anonymous, null, name, inputs, outputs, Type.event);
super(anonymous, null, name, inputs, outputs, Type.event, false);
}

public List<?> decode(byte[] data, byte[][] topics) {
Expand Down
Loading

0 comments on commit 8d2a5ab

Please sign in to comment.