Examples of addBalance()


Examples of is.currency.syst.AccountContext.addBalance()

        AccountContext account = this.currency.getAccountManager().getAccount(playerName);
        if (account == null) {
            return new EconomyResponse(0.0, 0.0, ResponseType.FAILURE, "That account does not exist");
        }  
        account.addBalance(amount);
        return new EconomyResponse(amount, account.getBalance(), ResponseType.SUCCESS, "");
    }

    @Override
    public EconomyResponse createBank(String name, String player) {
View Full Code Here

Examples of is.currency.syst.AccountContext.addBalance()

        AccountContext account = this.currency.getAccountManager().getAccount(name);
        if (account == null) {
            return new EconomyResponse(0, 0, ResponseType.FAILURE, "That account does not exist!");
        } else {
            account.addBalance(amount);
            return new EconomyResponse(amount, account.getBalance(), ResponseType.SUCCESS, "");
        }
    }

    @Override
View Full Code Here

Examples of org.ethereum.db.RepositoryImpl.addBalance()

 
              AccountState accountState = testCase.getPre().get(key);
 
              repository.createAccount(key.getData());
              repository.saveCode(key.getData(), accountState.getCode());
              repository.addBalance(key.getData(), new BigInteger(accountState.getBalance()));
 
              for (long i = 0; i < accountState.getNonceLong(); ++i)
                  repository.increaseNonce(key.getData());
          }
 
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

 
              AccountState accountState = testCase.getPre().get(key);
 
              repository.createAccount(key.getData());
              repository.saveCode(key.getData(), accountState.getCode());
              repository.addBalance(key.getData(), new BigInteger(accountState.getBalance()));
 
              for (long i = 0; i < accountState.getNonceLong(); ++i)
                  repository.increaseNonce(key.getData());
          }
 
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        ProgramInvokeMockImpl pi =  new ProgramInvokeMockImpl();
        pi.setOwnerAddress(contractAddrB);
        Repository repository = pi.getRepository();

        repository.createAccount(callerAddrB);
        repository.addBalance(callerAddrB, new BigInteger("100000000000000000000"));

        repository.createAccount(contractAddrB);
        repository.saveCode(contractAddrB, codeB);
        repository.addStorageRow(contractAddrB, key1, value1);
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        BigInteger balance0 = repository.getBalance(Hex.decode(addr));

        repository.createAccount(Hex.decode(addr));
        BigInteger balance1 = repository.getBalance(Hex.decode(addr));

        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(300));
        BigInteger balance2 = repository.getBalance(Hex.decode(addr));

        assertEquals(0, balance0.intValue());
        assertEquals(0,   balance1.intValue());
        assertEquals(300, balance2.intValue());
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        BigInteger balance0 = repository.getBalance(Hex.decode(addr));

        repository.createAccount(Hex.decode(addr));
        BigInteger balance1 = repository.getBalance(Hex.decode(addr));

        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(300));
        BigInteger balance2 = repository.getBalance(Hex.decode(addr));

        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(-150));
        BigInteger balance3 = repository.getBalance(Hex.decode(addr));
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        BigInteger balance1 = repository.getBalance(Hex.decode(addr));

        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(300));
        BigInteger balance2 = repository.getBalance(Hex.decode(addr));

        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(-150));
        BigInteger balance3 = repository.getBalance(Hex.decode(addr));

        assertEquals(0, balance0.intValue());
        assertEquals(0,   balance1.intValue());
        assertEquals(300, balance2.intValue());
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        repository.createAccount(contractB_addr_bytes);
        repository.saveCode(contractB_addr_bytes, codeB);

        repository.createAccount(caller_addr_bytes);
        repository.addBalance(caller_addr_bytes, new BigInteger("100000000000000000000"));


        // ****************** //
        //  Play the program  //
        // ****************** //
 
View Full Code Here

Examples of org.ethereum.facade.Repository.addBalance()

        repository.createAccount(contractB_addr_bytes);
        repository.saveCode(contractB_addr_bytes, codeB);

        repository.createAccount(caller_addr_bytes);
        repository.addBalance(caller_addr_bytes, new BigInteger("100000000000000000000"));

        // ****************** //
        //  Play the program  //
        // ****************** //
        VM vm = new VM();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.