Skip to content

Commit

Permalink
fix: rename incorrect nft post-condition codes
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Oct 19, 2022
1 parent 1e053e4 commit 9fed6a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/bns/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ export async function buildTransferNameTx({
];
const postConditionSender = createNonFungiblePostCondition(
publicKeyToAddress(getAddressVersion(network), createStacksPublicKey(publicKey)),
NonFungibleConditionCode.DoesNotSend,
NonFungibleConditionCode.Sends,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand All @@ -717,7 +717,7 @@ export async function buildTransferNameTx({
);
const postConditionReceiver = createNonFungiblePostCondition(
newOwnerAddress,
NonFungibleConditionCode.Sends,
NonFungibleConditionCode.DoesNotSend,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand Down
8 changes: 4 additions & 4 deletions packages/bns/tests/bns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ test('transferName', async () => {
const { namespace, name } = decodeFQN(fullyQualifiedName);
const nameTransferPostConditionOne = createNonFungiblePostCondition(
publicKeyToAddress(getAddressVersion(network), createStacksPublicKey(publicKey)),
NonFungibleConditionCode.DoesNotSend,
NonFungibleConditionCode.Sends,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand All @@ -718,7 +718,7 @@ test('transferName', async () => {
);
const nameTransferPostConditionTwo = createNonFungiblePostCondition(
newOwnerAddress,
NonFungibleConditionCode.Sends,
NonFungibleConditionCode.DoesNotSend,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand Down Expand Up @@ -777,7 +777,7 @@ test('transferName optionalArguments', async () => {
const { namespace, name } = decodeFQN(fullyQualifiedName);
const nameTransferPostConditionOne = createNonFungiblePostCondition(
publicKeyToAddress(getAddressVersion(network), createStacksPublicKey(publicKey)),
NonFungibleConditionCode.DoesNotSend,
NonFungibleConditionCode.Sends,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand All @@ -786,7 +786,7 @@ test('transferName optionalArguments', async () => {
);
const nameTransferPostConditionTwo = createNonFungiblePostCondition(
newOwnerAddress,
NonFungibleConditionCode.Sends,
NonFungibleConditionCode.DoesNotSend,
parseAssetInfoString(`${getBnsContractAddress(network)}.bns::names`),
tupleCV({
name: bufferCVFromString(name),
Expand Down
2 changes: 1 addition & 1 deletion packages/transactions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ import {

// With a standard principal
const postConditionAddress = 'SP2ZD731ANQZT6J4K3F5N8A40ZXWXC1XFXHVVQFKE';
const postConditionCode = NonFungibleConditionCode.Sends;
const postConditionCode = NonFungibleConditionCode.DoesNotSend;
const assetAddress = 'SP62M8MEFH32WGSB7XSF9WJZD7TQB48VQB5ANWSJ';
const assetContractName = 'test-asset-contract';
const assetName = 'test-asset';
Expand Down

1 comment on commit 9fed6a4

@vercel
Copy link

@vercel vercel bot commented on 9fed6a4 Oct 19, 2022

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.