-
-
Notifications
You must be signed in to change notification settings - Fork 247
Expand file tree
/
Copy pathtest_blocks.py
More file actions
22 lines (16 loc) · 626 Bytes
/
test_blocks.py
File metadata and controls
22 lines (16 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest
import warnings
from etherscan.blocks import Blocks
BLOCK = 2165403
BLOCK_REWARD = '5314181600000000000'
UNCLE_INCLUSION_REWARD = '312500000000000000'
API_KEY = 'YourAPIkey'
class BlocksTestCase(unittest.TestCase):
def setUp(self):
warnings.simplefilter('ignore', ResourceWarning)
def test_get_block_reward(self):
api = Blocks(api_key=(API_KEY))
reward_object = api.get_block_reward(BLOCK)
self.assertEqual(reward_object['blockReward'], BLOCK_REWARD)
self.assertEqual(reward_object['uncleInclusionReward'],
UNCLE_INCLUSION_REWARD)