예제 #1
0
def test_decode_various():
    data = ('0x00000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f10000000000000'
            '0000000000000000000000000000000000000000000000000017374757069642070696e6b20616e69'
            '6d616c000000000000000000000000000000000000000000000000000000000000000000000000000'
            '00000000000000000')

    expected = [b'82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 1,
                b'stupid pink animal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 0]
    output = decode_multi(['address', 'uint32', 'bytes32', 'int32'], data)
예제 #2
0
def test_decode_various():
    data = (
        '0x00000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f10000000000000'
        '0000000000000000000000000000000000000000000000000017374757069642070696e6b20616e69'
        '6d616c000000000000000000000000000000000000000000000000000000000000000000000000000'
        '00000000000000000')

    expected = [
        b'82a978b3f5962a5b0957d9ee9eef472ee55b42f1', 1,
        b'stupid pink animal\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
        0
    ]
    output = decode_multi(['address', 'uint32', 'bytes32', 'int32'], data)
예제 #3
0
def test_decode_two_uint32(input, expected):
    output = decode_multi(['uint32', 'uint32'], input)
    assert output == expected
예제 #4
0
def test_decode_two_uint32(input, expected):
    output = decode_multi(['uint32', 'uint32'], input)
    assert output == expected