eric-volz/DefichainPython

BUG: Misleading Usage of BuildToJson

Closed this issue · 1 comments

self.node.accounts.utxostoaccount(BuildToJson().add(self.address, "DFI", self.util.floor(amount, 8)), inputs=self.util.getTxInput(self.address))).build())

produces

    BuildToJson().add(self.address, "DFI", self.util.floor(amount, 8)).build(),
AttributeError: 'dict' object has no attribute 'build'

when building JSON and using additonal build() at end, the error above comes.
Using it without build() works perfectly fine.
add() already calls return self.json.build()

It should work with additional build() or else the build() should be removed in BuildToJson and only remains in BuildJson

Thanks for submitting,

I will look for it in the next few days when I finish logging.

It probably boils down to me rewriting this function. The old function will of course remain for compatibility reasons.

Then these functions will also be included in the documentation.