/greeter

Primary LanguageJavaScript

Bank.sol test notes

  1. start a testrpc server
$ testrpc
  1. start truffle console
$ truffle console
  1. get some accounts into some easy variables (our own little ENS wew)
$ web3.eth.accounts
$ account1 = web3.eth.accounts[0]
$ account2 = web3.eth.accounts[1]
$ account3 = web3.eth.accounts[2]

etc...

  1. set up a bank variable
$ bank = bank.at(bank.address)
  1. have fun.
$ bank.getBalance(account1)
$ bank.transfer(account2, 50)

transferring from the eth account 0 by default.

$ bank.getBalance(account2)

and transferring more than our balance, just burns gas, doesn't transfer.

$ bank.transfer(account3, 10000)