O3Labs / OzoneWalletIOS

The main repo for the O3 wallet on iOS
MIT License
9 stars 11 forks source link

Optimizations to script builder #192

Open WyattMufson opened 5 years ago

WyattMufson commented 5 years ago

You don't need to call pushData on a String since it will just end up calling pushHexString. This change just makes it a little clearer how the ScriptBuilder works.

WyattMufson commented 5 years ago

Also it looks like all of the non-typed portions of the script builder can be completely removed. pushContractInvoke is only being called by buildNEP5TransferScript which is not being used anywhere. This will allow for removing a large chunk of the script builder (I'm doing the same thing for neovm-utils)

saltyskip commented 5 years ago

if we change this can we remove pushData, buildNep5TransferScript, and pushContractInvoke from the project as well in this PR

WyattMufson commented 5 years ago

Sure thing. Are you only using the typed functions now?

saltyskip commented 5 years ago

Yes i believe only typed functions are necessary as every contract invoke should filter in as a DAPI request structure.

WyattMufson commented 5 years ago

I'm talking with Apisit about how to fix https://github.com/O3Labs/OzoneWalletIOS/blob/decf61d1ccbecca725cd4d803781b746ba9e363c/O3/New%20Group/Clients/Wallet.swift#L529

where script.count is bigger than 255.

WyattMufson commented 5 years ago

@saltyskip removed the rest. Didn't find a solution for when script.count is too big for UInt8