Closed oxarbitrage closed 5 years ago
No template function was needed, just a normal one. Function is created here https://github.com/bitshares/gwallet/commit/3aa698284b98fad5648658d340a037005b854350 and then applied to all operations at https://github.com/bitshares/gwallet/commit/fff49e35a9b0a8b91f49ddcfdc0c11ef9591d0af
sellasset was missing, added at https://github.com/bitshares/gwallet/commit/71d0b32610a17882aea0ed36d68d30b4ae716afc
For each command that do something in the blockchain(
transfer
,sell_asset
,vote_for_witness
, etc) theOnOK
method of the command class is called: https://github.com/bitshares/gwallet/blob/master/panels/transfer.cpp#L32This do some field conversion, validate some data, check if the cli is checked, create the command without broadcasting, present the confirmation dialog and finally executes and get a
signed_transaction
as response.In all commands, the same is done. An
Execute()
function with the number of arguments needed can be created i think incommands.cpp
to centralize this code and optimize it in one place.The tricky part i think is that you need to send wallet method name as argument and call the function, i think it can be done with something like this:
https://stackoverflow.com/a/7558083