Coder Social home page Coder Social logo

rise-py's People

Contributors

cryptoapi-project avatar jiy3ahko avatar jolie7 avatar mcventure avatar roosmaa avatar yriveiro avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rise-py's Issues

cannot import name 'RiseAPI'

Hello ,

I use some code of rise-py and getting import error :

from rise import RiseAPI

api = RiseAPI('http://127.0.0.1:5566')

result = api.accounts.open('secret')

if result['success']:
    print(result['account'])
else:
    print(result['error'])

Error :
ImportError: cannot import name 'RiseAPI'

Step to reproduce :

create and activate the virtual environment

virtualenv -p python3.6 envs
. envs/bin/activate

Install
pip install rise

Run the script :
python app.py

Error :
ImportError: cannot import name 'RiseAPI'

Extra details :
Python version : Python 3.5 and 3.6
Os : ubuntu 16.04

Transaction format assumptions mismatch for getNextForger

Travis periodic test job started failing with:

======================================================================
ERROR: test_get_next_forgers (tests.test_api.TestDelegatesAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/RiseVision/rise-py/tests/test_api.py", line 64, in test_get_next_forgers
    self.client.delegates.get_next_forgers()
  File "/home/travis/build/RiseVision/rise-py/risesdk/api/delegates.py", line 185, in get_next_forgers
    return NextForgersResult(r)
  File "/home/travis/build/RiseVision/rise-py/risesdk/api/delegates.py", line 97, in __init__
    self.current_block = BlockInfo(raw['currentBlock'])
  File "/home/travis/build/RiseVision/rise-py/risesdk/api/blocks.py", line 51, in __init__
    self.transactions = [TransactionInfo(t) for t in raw['transactions']]
  File "/home/travis/build/RiseVision/rise-py/risesdk/api/blocks.py", line 51, in <listcomp>
    self.transactions = [TransactionInfo(t) for t in raw['transactions']]
  File "/home/travis/build/RiseVision/rise-py/risesdk/api/transactions.py", line 22, in __init__
    self.row_id = int(raw['rowId'])
KeyError: 'rowId'

Either the rowId has been removed from that response recently. Or more likely since we're testing against the testnet the response didn't return any transactions, so the transaction parsing code was never hit for that input data.

Here's the raw JSON from the API with some transactions:

{"success":true,"currentBlock":{"id":"10498855636078481175","version":0,"timestamp":84731022,"previousBlock":"4797516196703717804","numberOfTransactions":3,"totalAmount":43650000,"totalFee":30000000,"reward":1200000000,"payloadLength":351,"payloadHash":"5e77e1e15f44cc2ba6d93f20564e2b1fca768fdc0fb7f8e0e3c380944376ded0","generatorPublicKey":"55520b5a485028a206ee7f4824af6f4bfe81dd11a7dc1e1ad5fac76e5f8671d6","blockSignature":"45ea7cffe95d70c0a9c6253a3ea23614a6dad1143f6b22764a9f95a21111d8bf702a0fff1d798e845117f82f493f6b99141b1870437d9c7bf493564f200f8709","transactions":[{"amount":14550000,"fee":10000000,"id":"12830119950664674103","recipientId":"123R","relays":1,"senderId":"13640984096060415228R","senderPublicKey":"3e992130a22a124b38998887f4c791c8e4d4b9d7c21522f2dffea5d09b4d8679","signature":"f9cb0aba86718e9d375a9863dab241c87b5600ac45a10dad78b84922cc185b3c153818425bba7122295218a2996026a8dcd50725364cc9b5888ffdd387ea2d05","timestamp":84731001,"type":0,"blockId":"10498855636078481175","height":1362995,"confirmations":1},{"amount":14550000,"fee":10000000,"id":"6963268403180107002","recipientId":"16634548345466606015R","relays":1,"senderId":"13640984096060415228R","senderPublicKey":"3e992130a22a124b38998887f4c791c8e4d4b9d7c21522f2dffea5d09b4d8679","signature":"438d9c3672ef7c96ca1f168a872c4487eaa27542c24acbf2d1cd7426a2f09fab0d788554ff2ab06adffb2a8b8948d3014aea534aa5dc058d79c0da86e2faa20f","timestamp":84731015,"type":0,"blockId":"10498855636078481175","height":1362995,"confirmations":1},{"amount":14550000,"fee":10000000,"id":"12066548054145478078","recipientId":"10984071503519026542R","relays":1,"senderId":"13640984096060415228R","senderPublicKey":"3e992130a22a124b38998887f4c791c8e4d4b9d7c21522f2dffea5d09b4d8679","signature":"39d5c634de55fc2b7fb255977545f13c24f81e81adf7691ec1e447d63681f832611b16001268b103d96a9d506c9b10bc25571504053d74c72fec5a2b42c33d01","timestamp":84731015,"type":0,"blockId":"10498855636078481175","height":1362995,"confirmations":1}],"height":1362995,"relays":1},"currentBlockSlot":3138186,"currentSlot":3138186,"delegates":["3f5ba319f06272a7904c3d37544f21623d9bf30abdf23d5dccfb48a73bfe752d","8af2d55a08d601eb1eccac81521e774526b4fa4627374c6ef15d9fd1e7cedfaf","63720ad592a48f35c47febec96bc81309391586ba4c3d161afc054c853662e4e","c3355f95fd9995d0095e9a598a8d4be5626002301ddc74656bb771565edc6848","1b388022277de1d3de9a9c02a78d6e32cf672f49ea1c7aebf07cc6dd614fb0a0","86fd31ba16044d2c679cf08a158d1f9bac9e829bd3c8c1b922f0a3aa61e3fa69","4af862b7ac32a6946e6fd440f31c79e4fb012b9e74360a0b9c384a02bf1985e6","ed52f1833c9c47efc23b916644515ac8789d2dc17649926a1d2cb3d7d038edac","a6ba5a3b75f6dc02981f7e967b285772b360edb337d8dda225d52364fea801b2","a208051c8c503d8e604f2c89ff847efec909596138513eeea16b6c4316c47d42"]}

open() method deprecated?

I want to open an account in python.

It seems the open() method is deprecated, is there a replacement or has it been removed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.