stacks-archive / stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
19 stars 17 forks source link

Wrong property postConditionMode in test 'make contract call with post condition mode allow' #49

Closed friedger closed 4 years ago

friedger commented 4 years ago

In the test about contract call with post condition mode the serialized string contains PostConditionMode 02 (deny), not 01 (allow)

https://github.com/blockstack/stacks-transactions-js/blob/8e8530aba67db7c770e7a6b8bc28864359ff89a6/tests/src/builder-tests.ts#L276

..a3586030200000000021ae6c05355e...

Is this intended? Or am I reading the bytes wrongly?

zone117x commented 4 years ago

The default is 0x02 (deny) and can be specified in the builder function https://github.com/blockstack/stacks-transactions-js/blob/8e8530aba67db7c770e7a6b8bc28864359ff89a6/src/builders.ts#L253

FWIU this is intentional

friedger commented 4 years ago

@zone117x The test specifies allow:

https://github.com/blockstack/stacks-transactions-js/blob/8e8530aba67db7c770e7a6b8bc28864359ff89a6/tests/src/builder-tests.ts#L258

zone117x commented 4 years ago

Oh I see, it's a typo postConditMode