You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Clarinet testing, the hex string needed to be passed in the tx options.
Using micro-stacks and a script, the hex string needed to be processed as bufferCV(hexToBytes(string)) instead of bufferCVFromString(string) to get the correct value.
Expected behavior
A clear way to know what value to provide, or confirmation that the values provided should be handled a different way.
The current implementation expects that the user enters utf8 that is converted to buffer using encodeClarityValue from stacks.js
This is useful, e.g. for BNS contract. This is not useful for e.g. PoX contract
Describe the bug
This started with testing a simple Clarity contract that can stack its own STX through pool delegation.
This contract call would not work from the sandbox, however is working from the local test as well as through a custom script.
To Reproduce
Steps to reproduce the behavior:
SP2HNY1HNF5X25VC7GZ3Y48JC4762AYFHKS061BM0.stacking-contract
stack-stx
u0
and should benone
)The resulting transaction then contains incorrect buffer values, should be (buff 1) and (buff 20):
Removing the leading
0x
on the hex string results in incorrect values as well:Using Clarinet testing, the hex string needed to be passed in the tx options.
Using micro-stacks and a script, the hex string needed to be processed as
bufferCV(hexToBytes(string))
instead ofbufferCVFromString(string)
to get the correct value.Expected behavior
A clear way to know what value to provide, or confirmation that the values provided should be handled a different way.
The correct result for the transaction would be:
Screenshots
From the sandbox:
From the script:
Additional context
Related transaction:
https://explorer.stacks.co/txid/dbbecf8113b530bd12ca67c425cc1c27a0bf7916ded65e106cf0ecc8fb28c75a?chain=mainnet
Related issues:
0x
fungible-systems/micro-stacks#171The text was updated successfully, but these errors were encountered: