neow3j
neow3j copied to clipboard
Convert from StackItem to ContractParameter and/or vice-versa
Summary or problem description
In a given use case (GrantShares) we need to compare StackItems (coming from a smart contract) to ContractParameters. This is a cumbersome thing to accomplish, given the types and incompatibility of objects.
Do you have any solution you want to propose?
Maybe, we could add methods like .toStackItem()
or .toContractParameter()
. However, we need to better analyze what's the best design.
What part of neow3j does this apply to?
- SDK
Instead of implementing mapping methods, i think we should rather have something like contractParam.compareTo(StackItem item)
. Such a method should do value comparison and provide some flexibility regarding the compared types.
I will review the current implementation in context of this issue.
I will review the current implementation in context of this issue.
I will keep this comment for posterity.