bitshares / python-bitshares

Fully featured client-side library for the BitShares Blockchain - written entirely in python.
http://docs.pybitshares.com/
MIT License
162 stars 167 forks source link

add samet fund and credit deal to operations.py #319

Closed litepresence closed 11 months ago

litepresence commented 1 year ago

this pull over rides 317 to include samet ops and deal with some bugs in the first pull; indexing error and errant usage of Optional() during credit deal create

xeroc commented 1 year ago

Good work. Would you mind adding some unittests for them?

Its super easy, really.

  1. Go to tests/test_transactions.py
  2. pick an existing one, replace the function name
  3. fill in your own operation with some random (but valid) data
  4. add a True to self.doit() as argument self.doit(True) which will print the serialized output in the commandline.
  5. run python3 -m pytest tests/test_transactions.py. Your unittest will break but you will see a long hex string which is what you copy paste into self.cm = "" and remove the True again.
  6. Confirm unittest works still.
  7. Done.
abitmore commented 1 year ago

Some tests are failing due to an issue in python-graphenelib, see https://github.com/xeroc/python-graphenelib/pull/188 for a potential fix.

pi314x commented 1 year ago

Shouldn't the kwargs in Credit_offer_update for delta_amount be the same (link to code)? ("delta_amount", Optional(Asset(kwargs["fee"]))),

abitmore commented 1 year ago

Shouldn't the kwargs in Credit_offer_update for delta_amount be the same (link to code)? ("delta_amount", Optional(Asset(kwargs["fee"]))),

See https://github.com/bitshares/python-bitshares/pull/325/commits/e640dc35ffe86f04aee763cfe2891a7acaf29386 . BTW I guess we can close this PR now.