forked from cypherstack/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_mint_transaction.py
31 lines (26 loc) · 779 Bytes
/
test_mint_transaction.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import address
from dumb25519 import random_point
from random import randrange
import mint_transaction
import unittest
class TestMint(unittest.TestCase):
def test_mint(self):
protocol_params = mint_transaction.ProtocolParameters(random_point(),random_point(),random_point(),random_point(),4,32)
address_params = address.AddressParameters(protocol_params.F,protocol_params.G)
# Mint data
public = address.SpendKey(address_params).public_address()
value = randrange(0,2**(8*protocol_params.value_bytes))
memo = 'Mint memo'
# Generate the spend transaction
transaction = mint_transaction.MintTransaction(
protocol_params,
public,
value,
memo
)
# Verify it
transaction.verify(
protocol_params
)
if __name__ == '__main__':
unittest.main()