hard-codr / sirius

Sirius: Stellar API for Humans
Other
6 stars 4 forks source link

error while creating account #2

Open BhumikaB opened 5 years ago

BhumikaB commented 5 years ago

I am trying import your project and trying to create using following code

from sirius import stellar
old_account_seed = "sxxxxxx"
new_account_address = "Gxxxxxxx"
amount = '1'
#following statement takes care of retrieving current sequence for account
#and signing and submitting at the end of with-block
with stellar.new_transaction(old_account_seed, memo='test-account') as t:
    t.create_account(new_account_address, amount)
if t.is_success():
    print (t.result())
else:
    print (t.errors())

It gives me error

Traceback (most recent call last):
  File "/home/stellar_python/sirius/stellar/test.py", line 8, in <module>
    t.create_account(new_account_address, amount)
  File "/home/stellar_python/sirius/stellar/api.py", line 910, in __exit__
    self.submit()
  File "/home/stellar_python/sirius/stellar/api.py", line 955, in submit
    self.trx_result = post_transaction(self.build())
  File "/home/stellar_python/sirius/stellar/api.py", line 914, in build
    account_seq = self.seq if self.seq else (int(account(self.account).fetch().sequence) + 1)
  File "/home/stellar_python/sirius/stellar/api.py", line 175, in fetch
    return self._map2obj(r)
  File "/home/stellar_python/sirius/stellar/api.py", line 306, in _map2obj
    return Accounts.Account(data)
  File "/homec/stellar_python/sirius/stellar/api.py", line 287, in __init__
    self.signers = [Accounts.Signer(s) for s in data['signers']]
  File "/home/stellar_python/sirius/stellar/api.py", line 287, in <listcomp>
    self.signers = [Accounts.Signer(s) for s in data['signers']]
  File "/home/stellar_python/sirius/stellar/api.py", line 260, in __init__
    self.public_key = data['public_key']
KeyError: 'public_key'
manran commented 5 years ago

Hi,

Horizon the Stellar API server had some protocol changes last days. The 'public_key' in signers has been removed in v 0.17.0

BhumikaB notifications@github.com 于 2019年3月18日周一 下午2:31写道:

I am trying import your project and trying to create using following code

from sirius import stellar old_account_seed = "sxxxxxx" new_account_address = "Gxxxxxxx" amount = '1'

following statement takes care of retrieving current sequence for account

and signing and submitting at the end of with-block

with stellar.new_transaction(old_account_seed, memo='test-account') as t: t.create_account(new_account_address, amount) if t.is_success(): print (t.result()) else: print (t.errors())

It gives me error

Traceback (most recent call last): File "/home/stellar_python/sirius/stellar/test.py", line 8, in t.create_account(new_account_address, amount) File "/home/stellar_python/sirius/stellar/api.py", line 910, in exit self.submit() File "/home/stellar_python/sirius/stellar/api.py", line 955, in submit self.trx_result = post_transaction(self.build()) File "/home/stellar_python/sirius/stellar/api.py", line 914, in build account_seq = self.seq if self.seq else (int(account(self.account).fetch().sequence) + 1) File "/home/stellar_python/sirius/stellar/api.py", line 175, in fetch return self._map2obj(r) File "/home/stellar_python/sirius/stellar/api.py", line 306, in _map2obj return Accounts.Account(data) File "/homec/stellar_python/sirius/stellar/api.py", line 287, in init self.signers = [Accounts.Signer(s) for s in data['signers']] File "/home/stellar_python/sirius/stellar/api.py", line 287, in self.signers = [Accounts.Signer(s) for s in data['signers']] File "/home/stellar_python/sirius/stellar/api.py", line 260, in init self.public_key = data['public_key'] KeyError: 'public_key'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hard-codr/sirius/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYh6qKrEkR6949uaUTXI8U3yUZ8s1Zgks5vXzLDgaJpZM4b5C_L .

BhumikaB commented 5 years ago

So now what is the solution for that