GithubHelp home page GithubHelp logo

Comments (3)

sbellem avatar sbellem commented on August 15, 2024

I assume the signature of simple_transaction or its alias create is confusing. This is a good reason to improve it.

It looks like you are passing a tuple for the from_address parameter. For example, the following works:

from transactions import Transactions
alice = 'mhyCaF2HFk7CVwKmyQ8TahgVdjnHSr1pTv'
bob = 'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7'
transactions = Transactions(testnet=True)
tx = transactions.create(alice, (bob, 10000))

but the following:

tx = transactions.create(('', alice), (bob, 10000))

will yield the error:

TypeError: list indices must be integers, not unicode

because the code is expecting a dict, but it got a list, and tried to retrieve the value 'txs' from the list:

[{u'address': u"(''",
  u'limit_txs': 200,
  u'nb_txs': 0,
  u'nb_txs_displayed': 0,
  u'txs': []},
 {u'address': u" 'mhyCaF2HFk7CVwKmyQ8TahgVdjnHSr1pTv')",
  u'limit_txs': 200,
  u'nb_txs': 0,
  u'nb_txs_displayed': 0,
  u'txs': []}]

from transactions.

liamzebedee avatar liamzebedee commented on August 15, 2024

Haha figured this out too! :) thanks.

from transactions.

sbellem avatar sbellem commented on August 15, 2024

Ok! Will close the ticket then. 😄

from transactions.

Related Issues (15)

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.