Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Add DAO code #34

Merged
merged 96 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
86ce351
Improvements for blind vote publishing
ManfredKarrer Apr 5, 2018
016d3b7
Renaming
ManfredKarrer Apr 8, 2018
daae653
Remove RevealedVote
ManfredKarrer Apr 8, 2018
747e933
Refactor proposal domain and make it more thread safe
ManfredKarrer Apr 11, 2018
30e74c9
Merge branch 'master_origin' into voting
ManfredKarrer Apr 11, 2018
f0b1385
Remove mutable fields of Tx, TxOutput and TxInput in PB definition
ManfredKarrer Apr 12, 2018
d2d2d8a
Refactorings (WIP)
ManfredKarrer Apr 12, 2018
3970892
Improve comment. Use Lombok.
ManfredKarrer Apr 13, 2018
b2c0171
Refactor handling of blocks in state class.
ManfredKarrer Apr 13, 2018
1d2b608
Rename ChangeParamEvent to AddChangeParamEvent
ManfredKarrer Apr 13, 2018
2528bc4
Remove ChangeParamEventList (WIP)
ManfredKarrer Apr 13, 2018
b4a56b9
Merge branch 'master_origin'
ManfredKarrer Apr 14, 2018
e60b972
Merge branch 'master' into voting
ManfredKarrer Apr 14, 2018
788e227
Change threading behaviour of ThreadContextAwareListeners
ManfredKarrer Apr 14, 2018
ebe53eb
Refactor state
ManfredKarrer Apr 17, 2018
f108351
Add comments
ManfredKarrer Apr 17, 2018
c302c3f
Rename Proposal to Ballot and ProposalPayload to Proposal
ManfredKarrer Apr 19, 2018
ac58192
Split BlindVote in BlindVote and BlindVotePayload
ManfredKarrer Apr 19, 2018
97b4c73
Rename classed with term CompensationRequest to Compensation
ManfredKarrer Apr 20, 2018
2ebe51e
Split Proposal into Proposal and ProposalPayload
ManfredKarrer Apr 20, 2018
ed29522
Merge branch 'master' into voting
ManfredKarrer Apr 20, 2018
9a3e001
Add option key daoActivated to enable all dao features for dev
ManfredKarrer Apr 20, 2018
735ce9c
Rename state change event classes
ManfredKarrer Apr 20, 2018
7bb2886
Move bisq.core.dao.consensus.vote.myvote package to bisq.core.dao
ManfredKarrer Apr 20, 2018
df65292
Remove usage of PeriodServiceFacade and ThreadAwareListener
ManfredKarrer Apr 22, 2018
3909c31
Merge branch 'rpc_thread' into voting
ManfredKarrer Apr 22, 2018
5822e6d
Cleanup
ManfredKarrer Apr 22, 2018
7e41b5a
Cleanup protobuffer file
ManfredKarrer Apr 24, 2018
37b12de
Add PB definition for State, Block and TxBlock
ManfredKarrer Apr 24, 2018
d7a7621
Add Cycle, PhaseWrapper and chainHeight and cycles in State to PB def…
ManfredKarrer Apr 24, 2018
2b9ed0b
Remove Meta data from block.
ManfredKarrer Apr 24, 2018
3483807
Refactor ParamChange domain
ManfredKarrer Apr 24, 2018
5fd8683
Store only proposal TxId + vote instead of whole ballot in BlindVote
ManfredKarrer Apr 25, 2018
086ed89
Use single threaded executor for rpc service
ManfredKarrer Apr 25, 2018
5645ddb
Add AccountAgeWitnessMap
ManfredKarrer Apr 27, 2018
9d498d7
Use a list in PB for AccountAgeWitnessStore for reducing disk space (…
ManfredKarrer Apr 27, 2018
cefed85
Merge branch 'storage-provider' into voting
ManfredKarrer Apr 27, 2018
9afe8e5
Add append-only storage for Proposal and BlindVote (WIP)
ManfredKarrer Apr 28, 2018
af9f163
Update to merged changes from p2p network. Renaming
ManfredKarrer Apr 28, 2018
b308411
Add protected data storage for proposal and blind vote
ManfredKarrer Apr 28, 2018
72e016d
Let proposal domain handle all its relevant use cases
ManfredKarrer Apr 30, 2018
77adb37
Remove unneeded Ballot subclasses
ManfredKarrer May 2, 2018
39f6d2d
Refactor handling of lists in BlindVote
ManfredKarrer May 2, 2018
24129f6
Use BlockHash and data for append-only store
ManfredKarrer May 6, 2018
770a491
Merge master
ManfredKarrer May 14, 2018
5655740
Merge branch 'master' into voting
ManfredKarrer May 27, 2018
6859712
Merge branch 'refactoring-mainviewmodel' into api-integration
ManfredKarrer Jun 6, 2018
cb5b708
Merge branch 'master' into voting
ManfredKarrer Jun 7, 2018
25bccfe
Remove protectedDataStore at blindVote
ManfredKarrer Jun 8, 2018
c86bc0c
Renaming payloads and stores
ManfredKarrer Jun 8, 2018
640b960
Support merit (WIP)
ManfredKarrer Jun 15, 2018
b42fbae
Merge branch 'api-integration' into voting
ManfredKarrer Jun 16, 2018
04bc6bf
Merge branch 'voting' into merit
ManfredKarrer Jun 16, 2018
a4dee48
Add merit implementation
ManfredKarrer Jun 19, 2018
aeadc3c
Merge branch 'merit' into voting
ManfredKarrer Jun 19, 2018
29c3610
Add lockup version
sqrrm Jun 19, 2018
b2e56e8
Add locktime, unlock_block_height to protobuf
sqrrm Jun 20, 2018
afed2e4
Merge pull request #1 from sqrrm/bonding
ManfredKarrer Jun 28, 2018
4c2b979
Merge branch 'master' into voting
ManfredKarrer Jun 28, 2018
1b17629
Update gradle files
ManfredKarrer Jun 29, 2018
f19f031
Add options to DevEnv. Cleanup
ManfredKarrer Jun 29, 2018
197e6e4
Refactor mutable data handling in State
ManfredKarrer Jun 29, 2018
6dd6e0f
Refactor MutableTx and MutableTxOutput
ManfredKarrer Jul 7, 2018
4208514
Apply fixes to stateService
ManfredKarrer Jul 7, 2018
ccc5340
Remove date and blockHash from ProposalPayload
ManfredKarrer Jul 8, 2018
950bf71
Use name instead of ordinal for PB ParamChangeMap
ManfredKarrer Jul 9, 2018
71075d0
Add param request
ManfredKarrer Jul 9, 2018
bf413d5
Rename
ManfredKarrer Jul 9, 2018
b52cc3c
Add PB support for changeParamProposal
ManfredKarrer Jul 9, 2018
75680f1
Change param map in state
ManfredKarrer Jul 9, 2018
b713969
Merge branch 'master' into voting
ManfredKarrer Jul 11, 2018
e564778
Show bond info, cleanups, handle non-BSQ funds
ManfredKarrer Jul 12, 2018
239484b
Add burn bond proposal
sqrrm Jul 18, 2018
bb702d2
Burn bonds when proposal is accepted
sqrrm Jul 21, 2018
84be256
Rename burn bond to confiscate bond
sqrrm Jul 21, 2018
35ae495
Merge pull request #2 from sqrrm/dao
ManfredKarrer Jul 21, 2018
92778a2
Changes from review of bond confiscation PR
ManfredKarrer Jul 21, 2018
928e5f9
Add BondedRoles proposal and views
ManfredKarrer Jul 23, 2018
a4eda3b
Merge branch 'master' into voting
ManfredKarrer Jul 23, 2018
c399c05
Add EqualsAndHashCode to PersistableLists
ManfredKarrer Jul 23, 2018
57a3fa9
Remvoe title and description from Proposal
ManfredKarrer Jul 25, 2018
b28a1e1
Merge branch 'refact-generics' into voting
ManfredKarrer Jul 25, 2018
bd9cb15
Update BsqState in PB, reorder fields
ManfredKarrer Aug 6, 2018
81db1de
Refactor Tx classes
ManfredKarrer Aug 6, 2018
d278067
Refactor TxOutput and Block classes
ManfredKarrer Aug 6, 2018
f05a1b0
Refactoring
ManfredKarrer Aug 7, 2018
fa31c11
Use DevEnv.logErrorAndThrowIfDevMode
ManfredKarrer Aug 8, 2018
c1dee68
Remove uid from Proposal
ManfredKarrer Aug 8, 2018
5d35af9
Remove BooleanVote and LongVote.
ManfredKarrer Aug 8, 2018
06b9370
Change version from -SNAPSHOT to 0.9.0
ManfredKarrer Aug 9, 2018
6e2fee1
Move genesis data from BsqState to GenesisTxInfo
ManfredKarrer Aug 11, 2018
b3929f6
Merge branch 'master' into voting
ManfredKarrer Aug 14, 2018
f6fc1fd
Merge branch 'voting'
ManfredKarrer Aug 14, 2018
89ff8fa
Merge branch 'master' into voting
ManfredKarrer Aug 14, 2018
f3939f0
Merge branch 'master' of https://github.com/bisq-network/bisq-common
ManfredKarrer Aug 15, 2018
88bb79c
Merge branch 'master' into merged-voting
ManfredKarrer Aug 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/main/java/bisq/common/app/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ public static void printVersion() {
'}');
}

public static final byte COMPENSATION_REQUEST_VERSION = (byte) 0x01;
public static final byte COMPENSATION_REQUEST = (byte) 0x01;
public static final byte PROPOSAL = (byte) 0x01;
public static final byte BLIND_VOTE_VERSION = (byte) 0x01;
public static final byte VOTE_REVEAL_VERSION = (byte) 0x01;
public static final byte BLIND_VOTE = (byte) 0x01;
public static final byte VOTE_REVEAL = (byte) 0x01;
public static final byte LOCKUP = (byte) 0x01;
}
4 changes: 2 additions & 2 deletions src/main/java/bisq/common/proto/ProtoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public static byte[] byteArrayOrNullFromProto(ByteString proto) {
* @param <E> the enum Type
* @return an enum
*/
@Nullable
public static <E extends Enum<E>> E enumFromProto(Class<E> enumType, String name) {
E result = Enums.getIfPresent(enumType, name).orNull();
if (result == null) {
if (result == null)
log.error("Invalid value for enum " + enumType.getSimpleName() + ": " + name);
}

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
import java.util.function.Function;
import java.util.stream.Stream;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Delegate;

@EqualsAndHashCode
public class PersistableList<T extends PersistablePayload> implements PersistableEnvelope, Iterable<T> {
@Delegate(excludes = ExcludesDelegateMethods.class)
@Getter
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/bisq/common/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package bisq.common.storage;

import bisq.common.app.DevEnv;
import bisq.common.proto.persistable.PersistableEnvelope;
import bisq.common.proto.persistable.PersistenceProtoResolver;

Expand Down Expand Up @@ -165,6 +166,7 @@ private T getPersisted() {
try {
// We keep a backup which might be used for recovery
fileManager.removeAndBackupFile(fileName);
DevEnv.logErrorAndThrowIfDevMode(t.toString());
} catch (IOException e1) {
e1.printStackTrace();
log.error(e1.getMessage());
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/bisq/common/util/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,21 @@ public static boolean isRestrictedCryptography() {
return name != null && name.equals("Java(TM) SE Runtime Environment")
&& ver != null && (ver.startsWith("1.7") || ver.startsWith("1.8"));
}

public static byte[] integerToByteArray(int intValue, int numBytes) {
byte[] bytes = new byte[numBytes];
for (int i = numBytes - 1; i >= 0; i--) {
bytes[i] = ((byte) (intValue & 0xFF));
intValue >>>= 8;
}
return bytes;
}

public static int byteArrayToInteger(byte[] bytes) {
int result = 0;
for (byte aByte : bytes) {
result = result << 8 | aByte & 0xff;
}
return result;
}
}
Loading