Examples of Wallet


Examples of org.ethereum.core.Wallet

        ECKey cowKey = ECKey.fromPrivate(HashUtil.sha3("cow".getBytes()));
        repository.createAccount(cowKey.getAddress());
        repository.addBalance(cowKey.getAddress(), BigInteger.TEN);

        Wallet wallet = new Wallet();
        wallet.setWorldManager(worldManager);

        wallet.importKey(cowKey.getPrivKeyBytes());

        Transaction tx = new Transaction(
                new byte[]{},
                Hex.decode("09184E72A000"),
                Hex.decode("03E8"),
                cowKey.getAddress(),
                Hex.decode("0A"),
                new byte[]{}
        );

        ECKey catKey = ECKey.fromPrivate(HashUtil.sha3("cat".getBytes()));
        tx.sign(catKey.getPrivKeyBytes());

        wallet.applyTransaction(tx);

        BigInteger walletBalance = wallet.getBalance(cowKey.getAddress());
        Assert.assertEquals(BigInteger.valueOf(20), walletBalance);
    }
View Full Code Here

Examples of org.ethereum.core.Wallet


    @Test
    public void testSave1() throws TransformerException, ParserConfigurationException {

        Wallet wallet = new Wallet();
        wallet.setWorldManager(worldManager);

    ECKey cowKey = ECKey.fromPrivate(HashUtil.sha3("cow".getBytes()));
    ECKey catKey = ECKey.fromPrivate(HashUtil.sha3("cat".getBytes()));

        wallet.importKey(cowKey.getPrivKeyBytes());
        wallet.importKey(catKey.getPrivKeyBytes());

        wallet.setHigh(4354);

        wallet.save();
    }
View Full Code Here

Examples of org.ethereum.core.Wallet

    @Test
    @Ignore
  public void testLoad1() throws TransformerException,
      ParserConfigurationException, IOException, SAXException {
        Wallet wallet = new Wallet();
        wallet.load();
    }
View Full Code Here

Examples of org.ethereum.core.Wallet

  public Transaction call() throws Exception {

    try {
      logger.info("Call() tx: {}", tx.toString());

            Wallet wallet = worldManager.getWallet();
            ChannelManager channelManager = worldManager.getChannelManager();

      WalletTransaction walletTransaction = wallet.addByWalletTransaction(tx);
      channelManager.sendTransaction(tx);

      while (walletTransaction.getApproved() < 1) {
        sleep(10);
      }
View Full Code Here

Examples of org.hibernate.ejb.test.Wallet

  }

  public void testExplicitPositionalParameter() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();
    em.getTransaction().begin();
    Query query = em.createQuery( "select w from " + Wallet.class.getName() + " w where w.brand in ?1" );
    List brands = new ArrayList();
View Full Code Here

Examples of org.hibernate.ejb.test.Wallet

  }

  public void testPositionalParameterForms() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();

    em.getTransaction().begin();
    // first using jpa-style positional parameter
View Full Code Here

Examples of org.hibernate.ejb.test.Wallet

  }

  public void testPositionalParameterWithUserError() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.flush();


    try {
View Full Code Here

Examples of org.hibernate.ejb.test.Wallet

  }

  public void testNativeQuestionMarkParameter() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();
    em.getTransaction().begin();
    Query query = em.createNativeQuery( "select * from Wallet w where w.brand = ?", Wallet.class );
    query.setParameter( 1, "Lacoste" );
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.