Class: Sibit::Fake
- Inherits:
-
Object
- Object
- Sibit::Fake
- Defined in:
- lib/sibit/fake.rb
Overview
Fake API
Instance Method Summary collapse
- #balance(_address) ⇒ Object
- #block(hash) ⇒ Object
- #fees ⇒ Object
- #height(_hash) ⇒ Object
- #latest ⇒ Object
- #next_of(_hash) ⇒ Object
- #price(_cur = 'USD') ⇒ Object
- #push(hex) ⇒ Object
- #utxos(_sources) ⇒ Object
Instance Method Details
#balance(_address) ⇒ Object
49 50 51 |
# File 'lib/sibit/fake.rb', line 49 def balance(_address) 100_000_000 end |
#block(hash) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/sibit/fake.rb', line 65 def block(hash) { provider: self.class.name, hash: hash, orphan: false, next: hash, previous: hash, txns: [ { hash: hash, outputs: [ { address: '1HqhZx8U18TYS5paraTM1MzUQWb7ZbcG9u', value: 1000 } ] } ] } end |
#fees ⇒ Object
45 46 47 |
# File 'lib/sibit/fake.rb', line 45 def fees { S: 12, M: 45, L: 100, XL: 200 } end |
#height(_hash) ⇒ Object
41 42 43 |
# File 'lib/sibit/fake.rb', line 41 def height(_hash) 1 end |
#latest ⇒ Object
61 62 63 |
# File 'lib/sibit/fake.rb', line 61 def latest '00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71' end |
#next_of(_hash) ⇒ Object
37 38 39 |
# File 'lib/sibit/fake.rb', line 37 def next_of(_hash) nil end |
#price(_cur = 'USD') ⇒ Object
33 34 35 |
# File 'lib/sibit/fake.rb', line 33 def price(_cur = 'USD') 4_000 end |
#push(hex) ⇒ Object
57 58 59 |
# File 'lib/sibit/fake.rb', line 57 def push(hex) # Nothing to do here end |
#utxos(_sources) ⇒ Object
53 54 55 |
# File 'lib/sibit/fake.rb', line 53 def utxos(_sources) [] end |