Exemple #1
0
 def test_check_signature(self, client_regtest):
     client = client_regtest
     sig = 'edsigu3QszDjUpeqYqbvhyRxMpVFamEnvm9FYnt7YiiNt' \
           + '9nmjYfh8ZTbsybZ5WnBkhA7zfHsRVyuTnRsGLR6fNHt1Up1FxgyRtF'
     assert_run_script_success(
         client, path.join(OPCODES_CONTRACT_PATH,
                           'check_signature.tz'), f'(Pair "{sig}" "hello")',
         '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"')
     assert_run_script_failwith(
         client, path.join(OPCODES_CONTRACT_PATH,
                           'check_signature.tz'), f'(Pair "{sig}" "abcd")',
         '"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"')
Exemple #2
0
 def test_packunpack(self, client_regtest):
     """Test PACK/UNPACK and binary format."""
     client = client_regtest
     assert_run_script_success(
         client, path.join(OPCODES_CONTRACT_PATH, 'packunpack.tz'), 'Unit',
         '(Pair (Pair (Pair "toto" {3;7;9;1}) {1;2;3}) ' +
         '0x05070707070100000004746f746f020000000800030' +
         '007000900010200000006000100020003)')
     assert_run_script_failwith(
         client, path.join(OPCODES_CONTRACT_PATH, 'packunpack.tz'), 'Unit',
         '(Pair (Pair (Pair "toto" {3;7;9;1}) {1;2;3}) ' +
         '0x05070707070100000004746f746f020000000800030' +
         '0070009000102000000060001000200030004)')