Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Optimizations to script builder #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Optimizations to script builder #192

wants to merge 2 commits into from

Conversation

WyattMufson
Copy link

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
Copy link
Author

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
Copy link

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

@WyattMufson
Copy link
Author

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

@saltyskip
Copy link

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

@WyattMufson
Copy link
Author

I'm talking with Apisit about how to fix

let scriptBytes = [UInt8(script.count)] + script

where script.count is bigger than 255.

@WyattMufson
Copy link
Author

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

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.

2 participants