Giter Club home page Giter Club logo

Comments (4)

dgpv avatar dgpv commented on August 16, 2024

I do it like this:

    def extract_transaction(self) -> CTransaction:
        sign_result = self.sign(KeyStore())
        if not sign_result.is_final:
            raise ValueError(
                'not all inputs have required signatures')

This also does the consistency checks along the way.

It may be a bit wasteful if you only want to know if final_* fields were set, but adding is_final() method that would only do self.final_script_witness or self.final_script_sig is not in the spirit of the library ("consistency where possible/reasonable").

Do you thinkg a convenience is_final() that does self.sign(KeyStore()).is_final() would be useful ?

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

Maybe take the final_script_witness and final_script_sig check logic from sign() into is_final() and call is_final() from sign().

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

Check out #46 (untested at the moment), what do you think ?

from python-bitcointx.

dgpv avatar dgpv commented on August 16, 2024

is_final() will be included in 1.1.1.post1, along with a fix to restore expected set_utxo(None, ...) semantics.

#46 passes tests, but could benefit from some review, nevertheless.

from python-bitcointx.

Related Issues (20)

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.