Testing OK
This commit is contained in:
parent
fe7ebfdea3
commit
14d111508e
|
@ -35,7 +35,7 @@ public class Config {
|
|||
//CHANNEL - CHAINCODE
|
||||
public static final String CHANNEL_NAME = "mychannel";
|
||||
|
||||
public static final String CHAINCODE_NAME = "monnethic_5";
|
||||
public static final String CHAINCODE_NAME = "monnethic_6";
|
||||
//public static final String CHAINCODE_PROD = "monnethic-prod";
|
||||
|
||||
//PEER 0
|
||||
|
|
|
@ -85,6 +85,7 @@ public class WalletImplementation {
|
|||
UserDao userDao = new UserDao();
|
||||
User association = userDao.getUserWithHash(associationHash);
|
||||
if(association != null){
|
||||
System.out.println("CHECK PWD");
|
||||
if(BCrypt.checkpw(associationPwd, association.getPassword())){
|
||||
|
||||
double newBalance = 0.0;
|
||||
|
@ -99,6 +100,7 @@ public class WalletImplementation {
|
|||
}
|
||||
|
||||
}else {
|
||||
System.out.println("WRONG PDW");
|
||||
throw new Exception("NOT ALLOWED");
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
public class CreateDataSetProcess {
|
||||
public class CreateDataSetProcess { //OK
|
||||
private static Logger logger = Logger.getLogger(CreateDataSetProcess.class);
|
||||
private static String gonetteHash = "";
|
||||
private static String userHashA = "";
|
||||
|
@ -17,13 +17,16 @@ public class CreateDataSetProcess {
|
|||
private static String walletHash1UserB = "";
|
||||
private static String walletHash2UserB = "";
|
||||
|
||||
|
||||
public static void main(String [ ] args){
|
||||
BasicConfigurator.configure();
|
||||
User association = new User("Gonette","Association","gonette-lyon@gmail.com","asso_GonE8977&4$*-","gonette");
|
||||
User userA = new User("Meunier","Thomas","thomas.meunier@gmail.com","thomasPwd158$*","gonette");
|
||||
User userB = new User("Petit","Claire","claire.petit@gmail.com","gonClaire789$*","0607080900","gonette");
|
||||
|
||||
String assoPwd = association.getPassword();
|
||||
String userBPwd = userB.getPassword();
|
||||
|
||||
|
||||
registerUser(association);
|
||||
association.setUser_hash(gonetteHash);
|
||||
registerUser(userA);
|
||||
|
@ -44,11 +47,11 @@ public class CreateDataSetProcess {
|
|||
createWallet(walletAUserB);
|
||||
createWallet(walletBUserB);
|
||||
|
||||
setBalance(association.getUser_hash(), association.getPassword(), walletBUserA.getWallet_hash(),120);
|
||||
setBalance(association.getUser_hash(), association.getPassword(), walletAUserB.getWallet_hash(),50);
|
||||
|
||||
doTransaction(userB.getUser_hash(), userB.getPassword(), walletAUserB.getWallet_hash(),walletBUserA.getWallet_hash(),10,userB.getAssociation());
|
||||
setBalance(association.getUser_hash(), assoPwd, walletBUserA.getWallet_hash(),120);
|
||||
setBalance(association.getUser_hash(), assoPwd, walletAUserB.getWallet_hash(),50);
|
||||
|
||||
doTransaction(userB.getUser_hash(), userBPwd, walletAUserB.getWallet_hash(),walletBUserA.getWallet_hash(),10,userB.getAssociation());
|
||||
}
|
||||
|
||||
private static void registerUser(User user){
|
||||
|
|
|
@ -71,6 +71,7 @@ public class WalletImplementationTest {
|
|||
|
||||
|
||||
|
||||
/*
|
||||
@Test
|
||||
public void TestSetBalance(){ //OK
|
||||
BasicConfigurator.configure();
|
||||
|
@ -81,6 +82,7 @@ public class WalletImplementationTest {
|
|||
logger.warn("Error: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue