Commit 9996d5f5 authored by Schudel, MJ (Michel)'s avatar Schudel, MJ (Michel)

more refactoring

parent 65c585bb
......@@ -21,7 +21,7 @@ apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'nl.craftsmen.craftsmencoinnode'
group = 'nl.craftsmen.craftscoinnode'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
......
package nl.craftsmen.blockchain.craftsmencoinnode;
package nl.craftsmen.blockchain.craftscoinnode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package nl.craftsmen.blockchain.craftsmencoinnode;
package nl.craftsmen.blockchain.craftscoinnode;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.Block;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.BlockChain;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.BlockchainManager;
import nl.craftsmen.blockchain.craftsmencoinnode.network.Network;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftsmencoinnode.wallet.WalletDto;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.Block;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.BlockChain;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.BlockchainManager;
import nl.craftsmen.blockchain.craftscoinnode.network.Network;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.wallet.WalletDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......
package nl.craftsmen.blockchain.craftsmencoinnode;
package nl.craftsmen.blockchain.craftscoinnode;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
package nl.craftsmen.blockchain.craftsmencoinnode.blockchain;
package nl.craftsmen.blockchain.craftscoinnode.blockchain;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import java.util.HashSet;
import java.util.Set;
......@@ -16,6 +16,7 @@ public class Block {
private String previousHash;
//default constructor needed for json deserialization
@SuppressWarnings({"unused", "WeakerAccess"})
public Block() {
}
......
package nl.craftsmen.blockchain.craftsmencoinnode.blockchain;
package nl.craftsmen.blockchain.craftscoinnode.blockchain;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import java.time.Instant;
import java.util.ArrayList;
......@@ -23,6 +23,7 @@ public class BlockChain {
return blockChain;
}
//default constructor, needed for json deserialization
@SuppressWarnings({"unused", "WeakerAccess"})
public BlockChain() {
}
......
package nl.craftsmen.blockchain.craftsmencoinnode.blockchain;
package nl.craftsmen.blockchain.craftscoinnode.blockchain;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import nl.craftsmen.blockchain.craftsmencoinnode.util.InstanceInfo;
import nl.craftsmen.blockchain.craftscoinnode.util.InstanceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......
package nl.craftsmen.blockchain.craftsmencoinnode.blockchain;
package nl.craftsmen.blockchain.craftscoinnode.blockchain;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.TransactionPool;
import nl.craftsmen.blockchain.craftsmencoinnode.wallet.WalletDto;
import nl.craftsmen.blockchain.craftsmencoinnode.network.Network;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.transaction.TransactionPool;
import nl.craftsmen.blockchain.craftscoinnode.wallet.WalletDto;
import nl.craftsmen.blockchain.craftscoinnode.network.Network;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......
package nl.craftsmen.blockchain.craftsmencoinnode.blockchain;
package nl.craftsmen.blockchain.craftscoinnode.blockchain;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
......
package nl.craftsmen.blockchain.craftsmencoinnode.network;
package nl.craftsmen.blockchain.craftscoinnode.network;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.Block;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.BlockChain;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftsmencoinnode.util.InstanceInfo;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.Block;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.BlockChain;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.util.InstanceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......
package nl.craftsmen.blockchain.craftsmencoinnode.network;
package nl.craftsmen.blockchain.craftscoinnode.network;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import nl.craftsmen.blockchain.craftsmencoinnode.util.InstanceInfo;
import nl.craftsmen.blockchain.craftscoinnode.util.InstanceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......
package nl.craftsmen.blockchain.craftsmencoinnode.transaction;
package nl.craftsmen.blockchain.craftscoinnode.transaction;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
......@@ -14,7 +14,8 @@ public class Transaction {
private String to;
private BigDecimal amount;
//default constructor, needed for json deserialization
//default public constructor, needed for json deserialization
@SuppressWarnings({"unused", "WeakerAccess"})
public Transaction() {
this.id = UUID.randomUUID();
}
......
package nl.craftsmen.blockchain.craftsmencoinnode.transaction;
package nl.craftsmen.blockchain.craftscoinnode.transaction;
import nl.craftsmen.blockchain.craftsmencoinnode.blockchain.BlockchainManager;
import nl.craftsmen.blockchain.craftscoinnode.blockchain.BlockchainManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
......
package nl.craftsmen.blockchain.craftsmencoinnode.util;
package nl.craftsmen.blockchain.craftscoinnode.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
package nl.craftsmen.blockchain.craftsmencoinnode.wallet;
package nl.craftsmen.blockchain.craftscoinnode.wallet;
import nl.craftsmen.blockchain.craftsmencoinnode.transaction.Transaction;
import nl.craftsmen.blockchain.craftscoinnode.transaction.Transaction;
import java.math.BigDecimal;
import java.util.List;
......
package nl.craftsmen.blockchain.craftsmencoinnode;
package nl.craftsmen.blockchain.craftscoinnode;
import nl.craftsmen.blockchain.craftsmencoinnode.util.InstanceInfo;
import nl.craftsmen.blockchain.craftscoinnode.util.InstanceInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment