Пример #1
0
def test_sign_trx():
    sign_hex = "01000000015048c6f29585c25c02c9dcf4174234fe798ed0ffefead3a76b1cc76aaf9f5693000000006a4730440220295cdce7565a3a56ecf288095e83c6ae9b031e85603637c446aea4b8b9971c6502201bc7e177a7deed0ae664594e451de8382453424457ec01c379d54c67e48327180121028ff24dc9bf0a9020a191f734815ace4bcce694c280b5d380883138577737ebb1ffffffff0100c2eb0b000000001a76a915669eaf74a91b268dfd4717051ab299a1f23c9c5bdac5ac0c000000000000000000000000000000000000000000"
    private_key = "0d7f27f7495c2779f1eee61e12fc1185fb7dd161997a7b64c7907eaa5ff7cdc3"
    inputs = [{
        "scriptPubKey": "76a915662250f9452ac336daaeee722615619d2ba1422793c5ac",
        "txid":
        "5048c6f29585c25c02c9dcf4174234fe798ed0ffefead3a76b1cc76aaf9f5693",
        "vout": 0,
        "signed_key": AccountFactory.new(private_key)
    }]
    outputs = [{
        "amount": 200000000,
        "assets": '000000000000000000000000',
        "address": '0x669eaf74a91b268dfd4717051ab299a1f23c9c5bda',
    }]
    tx = Transaction(inputs, outputs)
    assert tx.sign().to_hex() == sign_hex
Пример #2
0
def test_pay_to_contract_trx():
    sign_hex = "01000000015048c6f29585c25c02c9dcf4174234fe798ed0ffefead3a76b1cc76aaf9f5693000000006b483045022100f67e7cc2d074025a0fce0c11bd18b772bc3a200f130a8f5a7206118c42499693022077c30815ac3003042b70196639a3ec9f8e1625f6e7e58d49ff2fda02b528738c0121028ff24dc9bf0a9020a191f734815ace4bcce694c280b5d380883138577737ebb1ffffffff0100c2eb0b0000000017c2156358dab7cae438f9647e7eebea5697d9e6f2e95b810c000000000000000000000000000000000000000000"
    private_key = "0d7f27f7495c2779f1eee61e12fc1185fb7dd161997a7b64c7907eaa5ff7cdc3"
    inputs = [{
        "scriptPubKey": "76a915662250f9452ac336daaeee722615619d2ba1422793c5ac",
        "txid":
        "5048c6f29585c25c02c9dcf4174234fe798ed0ffefead3a76b1cc76aaf9f5693",
        "vout": 0,
        "signed_key": AccountFactory.new(private_key)
    }]
    outputs = [{
        "amount": 200000000,
        "assets": '000000000000000000000000',
        "address": '0x6358dab7cae438f9647e7eebea5697d9e6f2e95b81',
    }]
    tx = Transaction(inputs, outputs)
    assert tx.sign().to_hex() == sign_hex
Пример #3
0
def test_call_genesis_contract_trx():
    correct_sign_hex = "0100000001df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668000000006b4830450221009537ac6bec93c4352d0d40486c06a3da6c2613c924167abeed42951b5644eb8d02204e487836eefe84063d2f80be9a57de67f791b669147fded61482d1c489e945590121028ff24dc9bf0a9020a191f734815ace4bcce694c280b5d380883138577737ebb1ffffffff01000000000000000017c2156358dab7cae438f9647e7eebea5697d9e6f2e95b810c0000000000000000000000006f0001000000097765776574747474740000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000731323331323331000000000000000000000000000000000000000000000000000000000000000000"
    private_key = '0d7f27f7495c2779f1eee61e12fc1185fb7dd161997a7b64c7907eaa5ff7cdc3'
    inputs = [{
        "txid":
        "df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668",
        "vout": 0,
        "scriptPubKey": "76a915662250f9452ac336daaeee722615619d2ba1422793c5ac",
        "signed_key": AccountFactory.new(private_key)
    }]
    outputs = [{
        "amount": 0,
        "data":
        "000100000009776577657474747474000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000073132333132333100000000000000000000000000000000000000000000000000",
        "assets": "000000000000000000000000",
        "address": "0x6358dab7cae438f9647e7eebea5697d9e6f2e95b81",
        "contractType": "call"
    }]
    tx = Transaction(inputs, outputs)
    sign_hex = tx.sign().to_hex()
    assert sign_hex == correct_sign_hex
Пример #4
0
def test_call_contract_trx():
    correct_sign_hex = "0100000001df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668000000006a47304402205db66c8f6c3b9a121efa399be3b52b56f5e5e2067cf018a7c333d1f60202dd0702205ba4a40bc30ea1d52ef3f5f37991a2f4a49922349ece08e6e2ec1b9cf4a4a4060121028ff24dc9bf0a9020a191f734815ace4bcce694c280b5d380883138577737ebb1ffffffff01000000000000000001c10c0000000000000000000000006f0001000000097765776574747474740000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000731323331323331000000000000000000000000000000000000000000000000000852000000000000"
    private_key = '0d7f27f7495c2779f1eee61e12fc1185fb7dd161997a7b64c7907eaa5ff7cdc3'
    inputs = [{
        "txid":
        "df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668",
        "vout": 0,
        "scriptPubKey": "76a915662250f9452ac336daaeee722615619d2ba1422793c5ac",
        "signed_key": AccountFactory.new(private_key)
    }]
    outputs = [{
        "amount": 0,
        "data":
        "000100000009776577657474747474000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000073132333132333100000000000000000000000000000000000000000000000000",
        "assets": "000000000000000000000000",
        "address": "0x662250f9452ac336daaeee722615619d2ba1422793",
        "contractType": "create"
    }]
    tx = Transaction(inputs, outputs, gas_limit=21000)
    sign_hex = tx.sign().to_hex()
    assert sign_hex == correct_sign_hex
Пример #5
0
def test_create_template_trx():
    correct_sign_hex = "0100000001df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668000000006a47304402204a26fc57e847cc38ec0cd61f897ecff1538ea18b95f64e13c3842ee31e0077bb02205cb85f834178795665c2638fc688f83241c3bc9aadaa23bb96f2061be68644330121028ff24dc9bf0a9020a191f734815ace4bcce694c280b5d380883138577737ebb1ffffffff01000000000000000001c00c000000000000000000000000fdd72800010000000500001f79000009330000001465763630536080604052600060025534801561001557600080fd5b50611f54806100256000396000f30060806040526004361061008d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680626d0bac146100925780632efe9656146101a65780632fb97c1d146101d15780634e69149c146102705780638d824273146102b4578063abb8e213146103b9578063bbdd223b14610412578063c9d27afe14610489575b600080fd5b34801561009e57600080fd5b50610190600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190803590602001909291908035906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506104c2565b6040518082815260200191505060405180910390f35b3480156101b257600080fd5b506101bb610b2f565b6040518082815260200191505060405180910390f35b3480156101dd57600080fd5b506101e6610b39565b604051808361ffff1661ffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610234578082015181840152602081019050610219565b50505050905090810190601f1680156102615780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561027c57600080fd5b506102b2600480360381019080803574ffffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf3565b005b3480156102c057600080fd5b506102df60048036038101908080359060200190929190505050610c7c565b60405180806020018774ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200184815260200183600281111561033957fe5b60ff168152602001828103825288818151815260200191508051906020019080838360005b8381101561037957808201518184015260208101905061035e565b50505050905090810190601f1680156103a65780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b3480156103c557600080fd5b506103ce610e17565b604051808274ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041e57600080fd5b50610487600480360381019080803561ffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e42565b005b34801561049557600080fd5b506104c060048036038101908080359060200190929190803515159060200190929190505050610eb3565b005b60006104cc611c07565b60006040805190810160405280601381526020017f53544152545f564f54455f46554e4354494f4e00000000000000000000000000815250600460009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff1663b9af79c833610557610551306118c5565b856119b2565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156105f65780820151818401526020810190506105db565b50505050905090810190601f1680156106235780820380516001836020036101000a031916815260200191505b50935050505060206040518083038160008088803b15801561064457600080fd5b505af1158015610658573d6000803e3d6000fd5b505050506040513d602081101561066e57600080fd5b8101908080519060200190929190505050151561068a57600080fd5b60018a1480610699575060028a145b151561070d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f756e737570706f7274656420766f74652074797065000000000000000000000081525060200191505060405180910390fd5b8960011415610727576001891015151561072657600080fd5b5b896002141561074e5760018810158015610742575060648811155b151561074d57600080fd5b5b42871115156107c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f696e76616c696420766f746520656e642074696d65000000000000000000000081525060200191505060405180910390fd5b8a836000018190525033836020019074ffffffffffffffffffffffffffffffffffffffffff16908174ffffffffffffffffffffffffffffffffffffffffff168152505089836040018181525050888360600181815250508783608001818152505060006040519080825280602002602001820160405280156108565781602001602082028038833980820191505090505b508360a00181905250600060405190808252806020026020018201604052801561088f5781602001602082028038833980820191505090505b508360c00181905250428360e00181815250508683610100018181525050600083610120019060028111156108c057fe5b908160028111156108cd57fe5b81525050600183610140019015159081151581525050858361016001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505084836101800181905250600160025401915082600360008481526020019081526020016000206000820151816000019080519060200190610970929190611cb3565b5060208201518160010160006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050190805190602001906109f4929190611d33565b5060c0820151816006019080519060200190610a11929190611d33565b5060e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff02191690836002811115610a4c57fe5b02179055506101408201518160090160016101000a81548160ff0219169083151502179055506101608201518160090160026101000a81548163ffffffff02191690837c01000000000000000000000000000000000000000000000000000000009004021790555061018082015181600a019080519060200190610ad1929190611dbf565b509050506002600081548092919060010191905055507f460e77e3c8455201c4722742a8a654c959331ac344ab1b2ecefdb2b500f129c8826040518082815260200191505060405180910390a1819350505050979650505050505050565b6000600254905090565b600060606000809054906101000a900461ffff166001808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be45780601f10610bb957610100808354040283529160200191610be4565b820191906000526020600020905b815481529060010190602001808311610bc757829003601f168201915b50505050509050915091509091565b80600560006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000806000806000806003600089815260200190815260200160002090508060090160019054906101000a900460ff1615610db157806000018160010160009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff168260050180549050836006018054905084600401548560090160009054906101000a900460ff16858054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d995780601f10610d6e57610100808354040283529160200191610d99565b820191906000526020600020905b815481529060010190602001808311610d7c57829003601f168201915b50505050509550965096509650965096509650610e0d565b60008060008060026040805190810160405280600c81526020017f6e6f207375636820766f7465000000000000000000000000000000000000000081525094939291908494508393508292508191509650965096509650965096505b5091939550919395565b6000600560009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff16905090565b7466dbdd2826fb068f2929af065b04c0804d0397b09e3374ffffffffffffffffffffffffffffffffffffffffff16141515610e7c57600080fd5b816000806101000a81548161ffff021916908361ffff1602179055508060019080519060200190610eae929190611e3f565b505050565b6000806040805190810160405280600d81526020017f564f54455f46554e4354494f4e00000000000000000000000000000000000000815250600460009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff1663b9af79c833610f3f610f39306118c5565b856119b2565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fde578082015181840152602081019050610fc3565b50505050905090810190601f16801561100b5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038160008088803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050506040513d602081101561105657600080fd5b8101908080519060200190929190505050151561107257600080fd5b6003600086815260200190815260200160002092508260090160019054906101000a900460ff1680156110cc57508260090160009054906101000a900460ff1660028111156110bd57fe5b600060028111156110ca57fe5b145b1515611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f766f7465206e6f74206578697374206f72206e6f74206f6e676f696e6700000081525060200191505060405180910390fd5b82600701544210158015611158575082600801544211155b15156111cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f742076616c696420766f74652074696d650000000000000000000000000081525060200191505060405180910390fd5b33915082600b0160008374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f616c726561647920766f7465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600183600b0160008474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082600201546001141561158a5783156114f457826005018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff160217905550508260030154836005018054905014156114ef5760018360090160006101000a81548160ff021916908360028111156113a257fe5b02179055507fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff166040518084815260200183815260200182600281111561140657fe5b60ff168152602001935050505060405180910390a16114ee8360090160029054906101000a90047c01000000000000000000000000000000000000000000000000000000000284600a018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114e45780601f106114b9576101008083540402835291602001916114e4565b820191906000526020600020905b8154815290600101906020018083116114c757829003601f168201915b5050505050611b83565b5b611585565b826006018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff1602179055505060028360090160006101000a81548160ff0219169083600281111561157f57fe5b02179055505b61184a565b82600201546002141561184957831561179757826005018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555050826003015483600401540260648460050180549050021015156117925760018360090160006101000a81548160ff0219169083600281111561164557fe5b02179055507fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff16604051808481526020018381526020018260028111156116a957fe5b60ff168152602001935050505060405180910390a16117918360090160029054906101000a90047c01000000000000000000000000000000000000000000000000000000000284600a018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117875780601f1061175c57610100808354040283529160200191611787565b820191906000526020600020905b81548152906001019060200180831161176a57829003601f168201915b5050505050611b83565b5b611848565b826006018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff160217905550508260030154836004015460640302606484600601805490500211156118475760028360090160006101000a81548160ff0219169083600281111561184157fe5b02179055505b5b5b5b7fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff16604051808481526020018381526020018260028111156118a957fe5b60ff168152602001935050505060405180910390a15050505050565b606080600060146040519080825280601f01601f1916602001820160405280156118fe5781602001602082028038833980820191505090505b509150600090505b60148110156119a8578060130360080260020a8474ffffffffffffffffffffffffffffffffffffffffff1681151561193a57fe5b047f010000000000000000000000000000000000000000000000000000000000000002828281518110151561196b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611906565b8192505050919050565b606080606080606060008088955087945084518651016040519080825280601f01601f1916602001820160405280156119fa5781602001602082028038833980820191505090505b50935083925060009150600090505b8551811015611abc578581815181101515611a2057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515611a7f57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611a09565b600090505b8451811015611b74578481815181101515611ad857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515611b3757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611ac1565b82965050505050505092915050565b6000806000600560009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1692508351915081600401905060405185815260005b83811015611be2578060208701015181600401830152602081019050611bc1565b50600080838360008089600019f13d806000843e8160008114611c03578184f35b8184fd5b6101a06040519081016040528060608152602001600074ffffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016060815260200160608152602001600081526020016000815260200160006002811115611c7757fe5b815260200160001515815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611cf457805160ff1916838001178555611d22565b82800160010185558215611d22579182015b82811115611d21578251825591602001919060010190611d06565b5b509050611d2f9190611ebf565b5090565b828054828255906000526020600020908101928215611dae579160200282015b82811115611dad5782518260006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190611d53565b5b509050611dbb9190611ee4565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611e0057805160ff1916838001178555611e2e565b82800160010185558215611e2e579182015b82811115611e2d578251825591602001919060010190611e12565b5b509050611e3b9190611ebf565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611e8057805160ff1916838001178555611eae565b82800160010185558215611eae579182015b82811115611ead578251825591602001919060010190611e92565b5b509050611ebb9190611ebf565b5090565b611ee191905b80821115611edd576000816000905550600101611ec5565b5090565b90565b611f2591905b80821115611f2157600081816101000a81549074ffffffffffffffffffffffffffffffffffffffffff021916905550600101611eea565b5090565b905600a165627a7a72305820c81ddb39d443dba0986d0e993ec7395d1cf7887155b6a5a60219716dd089309700295b7b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20227375626a656374222c202274797065223a2022737472696e67227d2c207b226e616d65223a2022766f746554797065222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022746f74616c5061727469636970616e7473222c202274797065223a202275696e74323536227d2c207b226e616d65223a202270657263656e74222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022656e6454696d65222c202274797065223a202275696e74323536227d2c207b226e616d65223a202266756e63222c202274797065223a2022627974657334227d2c207b226e616d65223a2022706172616d222c202274797065223a20226279746573227d5d2c20226e616d65223a20227374617274566f7465222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a20226765744c617374566f74654964222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a202267657454656d706c617465496e666f222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e743136227d2c207b226e616d65223a2022222c202274797065223a2022737472696e67227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20225f6f7267616e697a6174696f6e436f6e7472616374222c202274797065223a202261646472657373227d5d2c20226e616d65223a20227365744f7267616e697a6174696f6e222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b7b226e616d65223a2022766f74654964222c202274797065223a202275696e74323536227d5d2c20226e616d65223a2022676574566f7465496e666f222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a2022737472696e67227d2c207b226e616d65223a2022222c202274797065223a202261646472657373227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e7438227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a20226765744f7267616e697a6174696f6e222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202261646472657373227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20225f63617465676f7279222c202274797065223a202275696e743136227d2c207b226e616d65223a20225f74656d706c6174654e616d65222c202274797065223a2022737472696e67227d5d2c20226e616d65223a2022696e697454656d706c617465222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a2022766f74654964222c202274797065223a202275696e74323536227d2c207b226e616d65223a20226174746974756465222c202274797065223a2022626f6f6c227d5d2c20226e616d65223a2022766f7465222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22616e6f6e796d6f7573223a2066616c73652c2022696e70757473223a205b7b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c20226e616d65223a2022437265617465566f7465222c202274797065223a20226576656e74227d2c207b22616e6f6e796d6f7573223a2066616c73652c2022696e70757473223a205b7b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e7438227d5d2c20226e616d65223a2022436f6e64756374566f7465222c202274797065223a20226576656e74227d5d736f6c696469747920736f7572636520636f64650000000000000000"
    private_key = '0d7f27f7495c2779f1eee61e12fc1185fb7dd161997a7b64c7907eaa5ff7cdc3'
    inputs = [{
        "txid":
        "df972a09734147ffafec91401bb9bea692d0922401277e476367a07df4b99668",
        "vout": 0,
        "scriptPubKey": "76a915662250f9452ac336daaeee722615619d2ba1422793c5ac",
        "signed_key": AccountFactory.new(private_key)
    }]
    outputs = [{
        "amount": 0,
        "data":
        "00010000000500001f79000009330000001465763630536080604052600060025534801561001557600080fd5b50611f54806100256000396000f30060806040526004361061008d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680626d0bac146100925780632efe9656146101a65780632fb97c1d146101d15780634e69149c146102705780638d824273146102b4578063abb8e213146103b9578063bbdd223b14610412578063c9d27afe14610489575b600080fd5b34801561009e57600080fd5b50610190600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190803590602001909291908035906020019092919080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506104c2565b6040518082815260200191505060405180910390f35b3480156101b257600080fd5b506101bb610b2f565b6040518082815260200191505060405180910390f35b3480156101dd57600080fd5b506101e6610b39565b604051808361ffff1661ffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610234578082015181840152602081019050610219565b50505050905090810190601f1680156102615780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561027c57600080fd5b506102b2600480360381019080803574ffffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf3565b005b3480156102c057600080fd5b506102df60048036038101908080359060200190929190505050610c7c565b60405180806020018774ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200186815260200185815260200184815260200183600281111561033957fe5b60ff168152602001828103825288818151815260200191508051906020019080838360005b8381101561037957808201518184015260208101905061035e565b50505050905090810190601f1680156103a65780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b3480156103c557600080fd5b506103ce610e17565b604051808274ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041e57600080fd5b50610487600480360381019080803561ffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e42565b005b34801561049557600080fd5b506104c060048036038101908080359060200190929190803515159060200190929190505050610eb3565b005b60006104cc611c07565b60006040805190810160405280601381526020017f53544152545f564f54455f46554e4354494f4e00000000000000000000000000815250600460009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff1663b9af79c833610557610551306118c5565b856119b2565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156105f65780820151818401526020810190506105db565b50505050905090810190601f1680156106235780820380516001836020036101000a031916815260200191505b50935050505060206040518083038160008088803b15801561064457600080fd5b505af1158015610658573d6000803e3d6000fd5b505050506040513d602081101561066e57600080fd5b8101908080519060200190929190505050151561068a57600080fd5b60018a1480610699575060028a145b151561070d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f756e737570706f7274656420766f74652074797065000000000000000000000081525060200191505060405180910390fd5b8960011415610727576001891015151561072657600080fd5b5b896002141561074e5760018810158015610742575060648811155b151561074d57600080fd5b5b42871115156107c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f696e76616c696420766f746520656e642074696d65000000000000000000000081525060200191505060405180910390fd5b8a836000018190525033836020019074ffffffffffffffffffffffffffffffffffffffffff16908174ffffffffffffffffffffffffffffffffffffffffff168152505089836040018181525050888360600181815250508783608001818152505060006040519080825280602002602001820160405280156108565781602001602082028038833980820191505090505b508360a00181905250600060405190808252806020026020018201604052801561088f5781602001602082028038833980820191505090505b508360c00181905250428360e00181815250508683610100018181525050600083610120019060028111156108c057fe5b908160028111156108cd57fe5b81525050600183610140019015159081151581525050858361016001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152505084836101800181905250600160025401915082600360008481526020019081526020016000206000820151816000019080519060200190610970929190611cb3565b5060208201518160010160006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301556080820151816004015560a08201518160050190805190602001906109f4929190611d33565b5060c0820151816006019080519060200190610a11929190611d33565b5060e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff02191690836002811115610a4c57fe5b02179055506101408201518160090160016101000a81548160ff0219169083151502179055506101608201518160090160026101000a81548163ffffffff02191690837c01000000000000000000000000000000000000000000000000000000009004021790555061018082015181600a019080519060200190610ad1929190611dbf565b509050506002600081548092919060010191905055507f460e77e3c8455201c4722742a8a654c959331ac344ab1b2ecefdb2b500f129c8826040518082815260200191505060405180910390a1819350505050979650505050505050565b6000600254905090565b600060606000809054906101000a900461ffff166001808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610be45780601f10610bb957610100808354040283529160200191610be4565b820191906000526020600020905b815481529060010190602001808311610bc757829003601f168201915b50505050509050915091509091565b80600560006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555050565b60606000806000806000806003600089815260200190815260200160002090508060090160019054906101000a900460ff1615610db157806000018160010160009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff168260050180549050836006018054905084600401548560090160009054906101000a900460ff16858054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d995780601f10610d6e57610100808354040283529160200191610d99565b820191906000526020600020905b815481529060010190602001808311610d7c57829003601f168201915b50505050509550965096509650965096509650610e0d565b60008060008060026040805190810160405280600c81526020017f6e6f207375636820766f7465000000000000000000000000000000000000000081525094939291908494508393508292508191509650965096509650965096505b5091939550919395565b6000600560009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff16905090565b7466dbdd2826fb068f2929af065b04c0804d0397b09e3374ffffffffffffffffffffffffffffffffffffffffff16141515610e7c57600080fd5b816000806101000a81548161ffff021916908361ffff1602179055508060019080519060200190610eae929190611e3f565b505050565b6000806040805190810160405280600d81526020017f564f54455f46554e4354494f4e00000000000000000000000000000000000000815250600460009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff1663b9af79c833610f3f610f39306118c5565b856119b2565b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fde578082015181840152602081019050610fc3565b50505050905090810190601f16801561100b5780820380516001836020036101000a031916815260200191505b50935050505060206040518083038160008088803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050506040513d602081101561105657600080fd5b8101908080519060200190929190505050151561107257600080fd5b6003600086815260200190815260200160002092508260090160019054906101000a900460ff1680156110cc57508260090160009054906101000a900460ff1660028111156110bd57fe5b600060028111156110ca57fe5b145b1515611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f766f7465206e6f74206578697374206f72206e6f74206f6e676f696e6700000081525060200191505060405180910390fd5b82600701544210158015611158575082600801544211155b15156111cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f742076616c696420766f74652074696d650000000000000000000000000081525060200191505060405180910390fd5b33915082600b0160008374ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f616c726561647920766f7465640000000000000000000000000000000000000081525060200191505060405180910390fd5b600183600b0160008474ffffffffffffffffffffffffffffffffffffffffff1674ffffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082600201546001141561158a5783156114f457826005018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff160217905550508260030154836005018054905014156114ef5760018360090160006101000a81548160ff021916908360028111156113a257fe5b02179055507fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff166040518084815260200183815260200182600281111561140657fe5b60ff168152602001935050505060405180910390a16114ee8360090160029054906101000a90047c01000000000000000000000000000000000000000000000000000000000284600a018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114e45780601f106114b9576101008083540402835291602001916114e4565b820191906000526020600020905b8154815290600101906020018083116114c757829003601f168201915b5050505050611b83565b5b611585565b826006018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff1602179055505060028360090160006101000a81548160ff0219169083600281111561157f57fe5b02179055505b61184a565b82600201546002141561184957831561179757826005018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555050826003015483600401540260648460050180549050021015156117925760018360090160006101000a81548160ff0219169083600281111561164557fe5b02179055507fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff16604051808481526020018381526020018260028111156116a957fe5b60ff168152602001935050505060405180910390a16117918360090160029054906101000a90047c01000000000000000000000000000000000000000000000000000000000284600a018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117875780601f1061175c57610100808354040283529160200191611787565b820191906000526020600020905b81548152906001019060200180831161176a57829003601f168201915b5050505050611b83565b5b611848565b826006018290806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff160217905550508260030154836004015460640302606484600601805490500211156118475760028360090160006101000a81548160ff0219169083600281111561184157fe5b02179055505b5b5b5b7fcab2adc99d0ef6402f4c188e9828070916ca728aba96bc3f14c6fd4a84a90559836005018054905084600601805490508560090160009054906101000a900460ff16604051808481526020018381526020018260028111156118a957fe5b60ff168152602001935050505060405180910390a15050505050565b606080600060146040519080825280601f01601f1916602001820160405280156118fe5781602001602082028038833980820191505090505b509150600090505b60148110156119a8578060130360080260020a8474ffffffffffffffffffffffffffffffffffffffffff1681151561193a57fe5b047f010000000000000000000000000000000000000000000000000000000000000002828281518110151561196b57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611906565b8192505050919050565b606080606080606060008088955087945084518651016040519080825280601f01601f1916602001820160405280156119fa5781602001602082028038833980820191505090505b50935083925060009150600090505b8551811015611abc578581815181101515611a2057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515611a7f57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611a09565b600090505b8451811015611b74578481815181101515611ad857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515611b3757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050611ac1565b82965050505050505092915050565b6000806000600560009054906101000a900474ffffffffffffffffffffffffffffffffffffffffff1692508351915081600401905060405185815260005b83811015611be2578060208701015181600401830152602081019050611bc1565b50600080838360008089600019f13d806000843e8160008114611c03578184f35b8184fd5b6101a06040519081016040528060608152602001600074ffffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016060815260200160608152602001600081526020016000815260200160006002811115611c7757fe5b815260200160001515815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611cf457805160ff1916838001178555611d22565b82800160010185558215611d22579182015b82811115611d21578251825591602001919060010190611d06565b5b509050611d2f9190611ebf565b5090565b828054828255906000526020600020908101928215611dae579160200282015b82811115611dad5782518260006101000a81548174ffffffffffffffffffffffffffffffffffffffffff021916908374ffffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190611d53565b5b509050611dbb9190611ee4565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611e0057805160ff1916838001178555611e2e565b82800160010185558215611e2e579182015b82811115611e2d578251825591602001919060010190611e12565b5b509050611e3b9190611ebf565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611e8057805160ff1916838001178555611eae565b82800160010185558215611eae579182015b82811115611ead578251825591602001919060010190611e92565b5b509050611ebb9190611ebf565b5090565b611ee191905b80821115611edd576000816000905550600101611ec5565b5090565b90565b611f2591905b80821115611f2157600081816101000a81549074ffffffffffffffffffffffffffffffffffffffffff021916905550600101611eea565b5090565b905600a165627a7a72305820c81ddb39d443dba0986d0e993ec7395d1cf7887155b6a5a60219716dd089309700295b7b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20227375626a656374222c202274797065223a2022737472696e67227d2c207b226e616d65223a2022766f746554797065222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022746f74616c5061727469636970616e7473222c202274797065223a202275696e74323536227d2c207b226e616d65223a202270657263656e74222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022656e6454696d65222c202274797065223a202275696e74323536227d2c207b226e616d65223a202266756e63222c202274797065223a2022627974657334227d2c207b226e616d65223a2022706172616d222c202274797065223a20226279746573227d5d2c20226e616d65223a20227374617274566f7465222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a20226765744c617374566f74654964222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a202267657454656d706c617465496e666f222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202275696e743136227d2c207b226e616d65223a2022222c202274797065223a2022737472696e67227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20225f6f7267616e697a6174696f6e436f6e7472616374222c202274797065223a202261646472657373227d5d2c20226e616d65223a20227365744f7267616e697a6174696f6e222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b7b226e616d65223a2022766f74654964222c202274797065223a202275696e74323536227d5d2c20226e616d65223a2022676574566f7465496e666f222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a2022737472696e67227d2c207b226e616d65223a2022222c202274797065223a202261646472657373227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b226e616d65223a2022222c202274797065223a202275696e7438227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a20747275652c2022696e70757473223a205b5d2c20226e616d65223a20226765744f7267616e697a6174696f6e222c20226f757470757473223a205b7b226e616d65223a2022222c202274797065223a202261646472657373227d5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a202276696577222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a20225f63617465676f7279222c202274797065223a202275696e743136227d2c207b226e616d65223a20225f74656d706c6174654e616d65222c202274797065223a2022737472696e67227d5d2c20226e616d65223a2022696e697454656d706c617465222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22636f6e7374616e74223a2066616c73652c2022696e70757473223a205b7b226e616d65223a2022766f74654964222c202274797065223a202275696e74323536227d2c207b226e616d65223a20226174746974756465222c202274797065223a2022626f6f6c227d5d2c20226e616d65223a2022766f7465222c20226f757470757473223a205b5d2c202270617961626c65223a2066616c73652c202273746174654d75746162696c697479223a20226e6f6e70617961626c65222c202274797065223a202266756e6374696f6e227d2c207b22616e6f6e796d6f7573223a2066616c73652c2022696e70757473223a205b7b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d5d2c20226e616d65223a2022437265617465566f7465222c202274797065223a20226576656e74227d2c207b22616e6f6e796d6f7573223a2066616c73652c2022696e70757473223a205b7b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e74323536227d2c207b22696e6465786564223a2066616c73652c20226e616d65223a2022222c202274797065223a202275696e7438227d5d2c20226e616d65223a2022436f6e64756374566f7465222c202274797065223a20226576656e74227d5d736f6c696469747920736f7572636520636f6465",
        "assets": "000000000000000000000000",
        "address": "0x6358dab7cae438f9647e7eebea5697d9e6f2e95b81",
        "contractType": "template"
    }]
    tx = Transaction(inputs, outputs)
    sign_hex = tx.sign().to_hex()
    assert sign_hex == correct_sign_hex
Пример #6
0
    contract = Contract(node, contract_address)
    # contract = Contract(node, c=compiled_contract, args=[org_name])

    # mint asset
    assert contract.execute("mint", [10000 * constant.COIN]).check() is constant.SUCCESS
    # get asset type
    asset_type = Asset.asset2str(contract.read("assettype"))
    # check contract balance
    assert contract.read("checkBalance") == 10000 * constant.COIN
    # transfer asset from contract
    assert contract.execute("transfer", [node.address, 100 * constant.COIN]).check() is constant.SUCCESS
    assert node.balance(asset=asset_type) == 100 * constant.COIN
    # check contract balance
    assert contract.read("checkBalance") == 9900 * constant.COIN
    # transfer to other address
    assert node.send(AccountFactory.new().address, 1 * constant.COIN, asset_type).check() is constant.SUCCESS
    # check balance
    assert node.balance(asset=asset_type) == 99 * constant.COIN
    # burn
    assert contract.execute("burn", asset_value=98 * constant.COIN, asset_type=asset_type).check() is constant.SUCCESS
    # check balance
    assert node.balance(asset=asset_type) == 1 * constant.COIN

    assert contract.read("voteValues", [88]) == 0
    tx = contract.vote("vote", [88], asset_type=asset_type)
    assert tx.check() is constant.SUCCESS
    # check balance
    assert node.balance(asset=asset_type) == 1 * constant.COIN
    logs = contract.fetch(tx.id)
    # fetch logs
    print(logs)
Пример #7
0
def node() -> Node:
    n = Node(private_key=AccountFactory.new().private_key)
    n.set_rpc_server("xxx")
    return n
Пример #8
0
def test_new_address():
    assert AccountFactory.generate_address(
        "bba692e559fda550d0157669b101bafddb23e7f57aeeb5cef5494e7a41a1f056"
    ) == "66c17b951f0c85b860c9f7f0d811c77ea78f2d2e3a"
Пример #9
0
def test_new_account():
    AccountFactory.new()
Пример #10
0
def test_private2public():
    assert AccountFactory.private2public(
        "0xbba692e559fda550d0157669b101bafddb23e7f57aeeb5cef5494e7a41a1f056"
    ) == b'043a68576342553357f042c6ede12bd3ed01cb61ad39848908883cab93f66c76016fb60b2b472d6caf316c699cb38f61d5daef3792402461ddc449a18b0fc8ee32'
Пример #11
0
 def test_send(self, node: Node):
     to_address = AccountFactory.new().address
     with patch.object(Session, "post", side_effect=self.post):
         assert node.send(to_address, 1).check() is constant.SUCCESS