当前位置: 首页>>代码示例>>Python>>正文


Python transaction_envelope.TransactionEnvelope类代码示例

本文整理汇总了Python中stellar_base.transaction_envelope.TransactionEnvelope的典型用法代码示例。如果您正苦于以下问题:Python TransactionEnvelope类的具体用法?Python TransactionEnvelope怎么用?Python TransactionEnvelope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TransactionEnvelope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: do

 def do(self, op):
     from stellar_base.transaction import Transaction
     from stellar_base.keypair import Keypair
     from stellar_base.transaction_envelope import TransactionEnvelope as Te
     tx = Transaction(source=self.source, opts={'sequence': self.seq})
     tx.add_operation(operation=op)
     envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
     signer = Keypair.from_seed(seed=self.seed)
     envelope.sign(keypair=signer)
     envelope_b64 = envelope.xdr()
     print(envelope_b64)
     return envelope_b64
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:12,代码来源:test_envelope.py

示例2: make_envelope

    def make_envelope(self, *args, **kwargs):
        from stellar_base.transaction import Transaction
        from stellar_base.keypair import Keypair
        from stellar_base.transaction_envelope import TransactionEnvelope as Te

        opts = {"sequence": self.seq, "fee": self.fee * len(args)}
        for opt, value in kwargs.items():
            opts[opt] = value
        tx = Transaction(source=self.address, opts=opts)
        for count, op in enumerate(args):
            tx.add_operation(operation=op)
        envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
        signer = Keypair.from_seed(seed=self.seed)
        envelope.sign(keypair=signer)
        envelope_b64 = envelope.xdr()
        print(envelope_b64)
        return envelope_b64
开发者ID:jobforp,项目名称:py-stellar-base,代码行数:17,代码来源:test_envelope.py

示例3: do_single_signer

def do_single_signer(operation_opts=False, tx_opts=False):
    assert operation_opts and tx_opts
    from stellar_base.operation import Payment
    from stellar_base.transaction import Transaction
    from stellar_base.keypair import Keypair
    from stellar_base.transaction_envelope import TransactionEnvelope as Te

    operation = Payment(opts=operation_opts)
    tx = Transaction(source=SOURCE, opts=tx_opts)
    tx.add_operation(operation=operation)
    envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
    signer = Keypair.from_seed(seed=SEED)
    envelope.sign(keypair=signer)
    envelope_b64 = bip(envelope)

    print(envelope_b64)
    return envelope_b64
开发者ID:nelisky,项目名称:py-stellar-base,代码行数:17,代码来源:test_cases.py

示例4: Payment

print('Anna: ', json.dumps(anna, sort_keys=True, indent=4 * ' '))
print('Bob: ', json.dumps(bob, sort_keys=True, indent=4 * ' '))

operation = Payment({
	'source': anna['address'],
	'destination': bob['address'],
	'asset': Asset.native(),
	'amount': '1000', # needs to be a string?
})
tx = Transaction(
	source=anna['address'],
	opts={
		'sequence': json.loads(requests.get(url+'/accounts/'+anna['address']).text)['sequence'],
		'timeBounds': [],
		'memo': NoneMemo(),
		'fee': 100,
		'operations': [
			operation,
		],
	},
)
envelope = Te(tx=tx, opts={"network_id": "TESTNET"})
envelope.sign(Keypair.from_seed(anna['seed']))

print('Tx: ', json.dumps(json.loads(requests.post(
	url=url+'/transactions',
	data={
		'tx': packer(envelope).decode('ascii')
	}
).text), sort_keys=True, indent=4 * ' '))
开发者ID:andela-osule,项目名称:py-stellar-base,代码行数:30,代码来源:sample.py

示例5: test_SetOptions_empty_unXdr

 def test_SetOptions_empty_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAc0+E2MAAABAymdhj3dFg+3TcCRILXdUu8ZhG3WOuBmX3YXcYJhYemjCDylQEk31vF8wxB/ntRg4/vmCYC2IwhBtw1mJZ8h+Bw=='
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例6: test_manageOffer_min_unXdr

 def test_manageOffer_min_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAMAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABAAAAAAAAAAHNPhNjAAAAQBTg1srmkpv/pFqELvCsSurwRPYRUpH05j1sgDzOZdILCdVpxb3sEvMgim1DXE0VhGXqbgZaQV/Sp2VH5C5RKQI='  # TODO
     print(result)
     print(Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:4,代码来源:test_envelope.py

示例7: test_createPassiveOffer_min_unXdr

 def test_createPassiveOffer_min_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAQAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABzT4TYwAAAEAm4lQf6g7mpnw05syhOt3ub+OmSADhSfLwn/xg6bD+6qwqlpF/xflNYWKU1uQOy4P9e1+SWIGJdR+KWryykS0M'  # TODO
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例8: test_inflation_unXdr

 def test_inflation_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAkAAAAAAAAAAc0+E2MAAABAL2tfdCYqdtfxvINWVZ0iwcROqxQieoBF9cay5AL2oj2oJDrp3F3sYlHQNJi1orkcMLqsxaGtr6DWdnc0vwIBDg=='
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例9: test_accountMerge_min_unXdr

 def test_accountMerge_min_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAc0+E2MAAABADFSYbdlswOKfK4Y02Tz/j5j83c7f5YvLe+QxmXcHSd/W8ika63MsM6CDkDZhjRx4+Nt+mfCKpKbP7j0NPzNhCQ=='
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例10: test_changeTrust_min_unXdr

 def test_changeTrust_min_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAYAAAABYmVlcgAAAACtrhaIK8Wv+/J1OJRtJAXQfCSoSs/zBzoFRBq/epJAjn//////////AAAAAAAAAAHNPhNjAAAAQL0R9eOS0qesc+HHKQoHMjFUJWvzeQOy+u/7HBHNooo37AOaG85y9jyNoa1D4EduroZmK8vCfCF0V3rn5o9CpgA='
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例11: test_pathPayment_min_unXdr

 def test_pathPayment_min_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAIAAAAAAAAAAACYloAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAAAAAAHNPhNjAAAAQFwSz9wwBEWCv9cNnuIq+Jjq36mXBI22f6uj/FZ6LbyLljkckSLkF/AqXcaOoOgY9mZ0NrXsHbA5/chSThtgMgQ='  # TODO
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例12: test_payment_short_unXdr

 def test_payment_short_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAEAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAc0+E2MAAABAzEdbP2ISsB9pDqmIRPt6WEK0GkVOgAEljnelNQjNpDig6A60+jMtveQjdCocL13GwVbO1B8VBXgQdlAobs0fDg=='
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例13: test_createAccount_unXdr

 def test_createAccount_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAJiWgAAAAAAAAAABzT4TYwAAAEBBR+eUTPqpyTBLiNMudfSl2AN+oZL9/yp0KE9SyYeIzM2Y7yQH+dGNlwz5PMaaCEGAD+82IZkAPSDyunElc+EP'
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例14: test_allowTrust_shortAsset_unXdr

 def test_allowTrust_shortAsset_unXdr(self):
     result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAcAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAACcG9ja2V0a25pdmVzAAAAAQAAAAAAAAABzT4TYwAAAEBK169VZqBQYUrs+ueQzx/UaANo+7HCdUcpflNvT4e5y7o+T7fxzJ845B3hVr8rrJ27Rz/VVslBWkXmxKoaa8sC'
     assert (result == Te.from_xdr(result).xdr())
开发者ID:bartekn,项目名称:py-stellar-base,代码行数:3,代码来源:test_envelope.py

示例15: te_xdr_build

def te_xdr_build(tx, secret):
    envelope = Envelope(tx)
    signer = Keypair.from_seed(secret)
    envelope.sign(signer)
    re = envelope.xdr()
    return re
开发者ID:andela-osule,项目名称:py-stellar-base,代码行数:6,代码来源:build.py


注:本文中的stellar_base.transaction_envelope.TransactionEnvelope类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。