Package org.ethereum.facade

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


        repository.startTracking();

        repository.createAccount(Hex.decode(addr));
        repository.addBalance(Hex.decode(addr), BigInteger.valueOf(expectedBalance));

        repository.commit();

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

        assertEquals(expectedBalance, balance.longValue());
    }
View Full Code Here


      } catch (RuntimeException e) {
        trackRepository.rollback();
        return new BigInteger(1, tx.getGasLimit()).longValue();
      }
      trackRepository.commit();
    } else {
      // REFUND GASDEBIT EXCEPT FOR FEE (500 + 5*TXDATA)
      long dataCost = tx.getData() == null ? 0: tx.getData().length * GasCost.TXDATA;
      gasUsed = GasCost.TRANSACTION + dataCost;
     
View Full Code Here

        }

        // 4. CREATE THE CONTRACT OUT OF RETURN
        byte[] code    = result.getHReturn().array();
        trackRepository.saveCode(newAddress, code);
        trackRepository.commit();
       
        // IN SUCCESS PUSH THE ADDRESS INTO THE STACK
        stackPush(new DataWord(newAddress));
       
        // 5. REFUND THE REMAIN GAS
View Full Code Here

                    this.memorySave(offset, allocSize, buffer.array());
            }
        }
       
        // 4. THE FLAG OF SUCCESS IS ONE PUSHED INTO THE STACK
        trackRepository.commit();
        stackPushOne();
       
        // 5. REFUND THE REMAIN GAS
        if (result != null) {
            BigInteger refundGas = msg.getGas().value().subtract(BigInteger.valueOf(result.getGasUsed()));
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.