Skip to content

Commit

Permalink
fix: remove post conditions in allow mode
Browse files Browse the repository at this point in the history
closes #1778
  • Loading branch information
beguene authored and fbwoolf committed Oct 6, 2021
1 parent 15d2ba6 commit c90ed29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-mails-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stacks/wallet-web': patch
---

This fixes the test-app post conditions that were causing contract call failures.
25 changes: 8 additions & 17 deletions test-app/src/components/debugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ export const Debugger = () => {
standardPrincipalCV('ST1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHEG3NHN3'),
trueCV(),
];
const postConditions = [
makeStandardSTXPostCondition(
address || '',
FungibleConditionCode.LessEqual,
new BN('100', 10)
)
]
await doContractCall({
fee: customFee,
network,
Expand All @@ -137,23 +144,7 @@ export const Debugger = () => {
functionArgs: args,
attachment: 'This is an attachment',
postConditionMode: mode,
postConditions: [
makeStandardSTXPostCondition(
address || '',
FungibleConditionCode.LessEqual,
new BN('100', 10)
),
makeStandardFungiblePostCondition(
'ST1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHEG3NHN3',
FungibleConditionCode.Equal,
new BN(1234),
createAssetInfo(
'ST1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHEG3NHN3',
'connect-token',
'connect-token'
)
),
],
postConditions,
onFinish: data => {
console.log('finished faker!', data);
console.log(data.stacksTransaction.auth.spendingCondition?.nonce.toNumber());
Expand Down

1 comment on commit c90ed29

@vercel
Copy link

@vercel vercel bot commented on c90ed29 Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.