Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Add raw tx building examples #665

Merged
merged 3 commits into from
Oct 14, 2018
Merged

Add raw tx building examples #665

merged 3 commits into from
Oct 14, 2018

Conversation

ixje
Copy link
Member

@ixje ixje commented Oct 13, 2018

What current issue(s) does this address, or what feature is it adding?
A common question in the #python support channel is how to build raw transactions alá neon-js that can be send over RPC using the sendrawtransaction method.

How did you solve this problem?
Add a commented file to \examples\ with 2 examples 1) building a ContractTransaction 2) building an InvocationTransaction

How did you make sure your solution works?
n/a

Are there any special changes in the code that we should be aware of?
no

Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

@ixje ixje requested a review from localhuman October 13, 2018 13:30
@ixje
Copy link
Member Author

ixje commented Oct 13, 2018

@localhuman is setting the Gas attribute for InvocationTransactions mandatory?

@coveralls
Copy link

coveralls commented Oct 13, 2018

Coverage Status

Coverage increased (+0.002%) to 82.048% when pulling cabfb60 on ixje:raw_tx_examples into 5a324b3 on CityOfZion:development.

@localhuman
Copy link
Collaborator

I don't think so, unless it will cost more than the 10 free gas.

One comment, you can import address_to_scripthash from neocore.bin.cli I think rather than adding it in the example.

Copy link
Collaborator

@localhuman localhuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very helpful!

@ixje
Copy link
Member Author

ixje commented Oct 14, 2018

That's what I thought (regarding the GAS question). As for the helper method, I was already surprised I couldn't find a utility function, didn't think of looking inside the neocore cli. I'll now stick with my current version as it also does the UInt160 conversion I need for the later functions, but thanks for pointing it out 👍

@ixje ixje merged commit bc233b0 into CityOfZion:development Oct 14, 2018
@ixje ixje deleted the raw_tx_examples branch October 14, 2018 09:38
jseagrave21 added a commit to jseagrave21/neo-python that referenced this pull request Oct 18, 2018
* Fix ExtendedJsonRpcApi (CityOfZion#662)

* Update ExtendedJsonRpcApi.py

- add fix provided by @localhuman so original methods are returned as well as extended methods

* Mute expected test stacktrace and clearly identify why an exception is thrown. (CityOfZion#663)

* Add guideline for adding tests to the neo-privnet-unittest image (CityOfZion#661)

* Add the option -u (unittest-net) to prompt.py

* Add unittest guildeline and add the smart contract source codes (UnitTest-SM.zip) to the fixtures package

* Add raw transaction building examples (CityOfZion#665)

* Update neo-boa version to fix core building test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants