A btcd simulator is available in cmd/btcd/btcd.go
. See the btcd simulator README.
These tests should be performed with the btcd simulator,
otherwise you cannot control the deposit conditions and would have to wait a long time for the real BTC network.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Send BTC equal to an exact multiple of the SKY/BTC rate.
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
For example, if the rate is 0.0001 BTC/SKY, send 0.002 BTC and receive 2 SKY.
The exact SKY amount should be sent.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Send BTC in an inexact multiple of the SKY/BTC rate.
For example, if the rate is 0.001 BTC/SKY, send 0.0025 BTC and receive 2 SKY.
The SKY amount should be sent rounded down.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Send less BTC than the price of the minimum unit of SKY.
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address did not receive anything
For example, if the rate is 0.001 BTC/SKY and the minimum unit is 1 SKY, send 0.0009 BTC and receive 0 SKY.
No SKY should be sent.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Send BTC to the address twice, in two separate transactions
- Wait for this deposit to process
- Confirm that both deposits were in the same block, in case the bitcoin network put them in different blocks
- Send BTC to the address again
- Wait for this deposit to process
- Check that the deposits are "done" using the status check in the web client
- Check that the SKY address receives the expected amount
All three deposits should process.
- Start teller with a btcd node and skycoin node running
- Bind an address to two different SKY addresses each
- Send BTC to both address, quickly enough so that they are in the same block
- Wait for these deposits to process
- Confirm that both deposits were in the same block, in case the bitcoin network put them in different blocks
- Check that the deposits are "done" using the status check in the web client
- Check that the SKY addresses receives the expected amount
Both deposits should process.
- Start teller without running a btcd node, but with a skycoin node
Teller should fail to start.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Stop the btcd node
- Make a BTC deposit
- Wait for the deposit to confirm at least 1 block
- Restart the btcd node
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
Teller should start up and begin scanning deposits. Then it will fail to scan more, but not exit. When btcd is restarted, scanning will resume, and the deposit will process.
- Start teller without running a skycoin node, but with a btcd node
Teller should fail to start
- Start teller with a btcd node and skycoin node running
- Bind an address
- Stop the skycoin node
- Make a BTC deposit
- Wait for the deposit to be scanned
- Wait for an error message about SKY failed to send
- Restart the skycoin node
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
Teller should start up and begin scanning deposits. Then it will scan the BTC deposit, and send it to the exchanger. The exchanger will save the deposit and try to send SKY. Sending SKY will fail while the skycoin node is offline. When the skycoin node is restarted, the send will occur.
If teller is shutdown before it sends SKY, it will send the SKY when it restarts, and at the SKY/BTC rate that was set when the deposit was processed
- Start teller with a btcd node and skycoin node running
- Bind an address
- Stop the skycoin node
- Make a BTC deposit
- Wait for the deposit to be scanned
- Wait for an error message about SKY failed to send
- Restart teller with a different SKY/BTC rate
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount at the original rate
Teller will resume sending SKY for scanned deposits when it restarts. When a deposit is processed, the current SKY/BTC rate is saved with the deposit. Teller will resume sending SKY based on the SKY/BTC rate at the time, so if the configurable rate has been changed, that deposit receives the expected rate.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Make a BTC deposit
- Wait for the deposit to be processed
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
- Restart teller
- Look for a log message about deposit already processed
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address did not receive more coins
Teller scans blocks from a fixed BTC blockchain height. When it restarts, it will rescan blocks that it has already scanned. When it detects a deposit that has already been processed, it will not process this deposit again.
- Start teller with a btcd node and skycoin node running
- Bind an address
- Make a BTC deposit
- Add sufficient coins to the skycoin wallet
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
- Start teller with a btcd node and skycoin node running
- Bind an address
- Make a BTC deposit
- Stop teller
- Add sufficient coins to the skycoin wallet
- Check that the deposit is "done" using the status check in the web client
- Check that the SKY address receives the expected amount
Teller will repeatedly try to create a transaction and send it until it succeeds. It will resume doing this between restarts.
If the BTC address pool runs out of addresses, a clear error is provided to the client and an error is logged
- Start teller with a btcd node and skycoin node running
- Use an empty btc_addresses.json file
- Bind an address
- Observe the error message in the client and in the logs
If the user binds too many addresses, a clear error is provided to the client and an error is logged
- Start teller with a btcd node and skycoin node running
- Use an empty btc_addresses.json file
- Bind an address
- Observe the error message in the client and in the logs