File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -931,10 +931,12 @@ class NftSwapV4 implements INftSwapV4 {
931931 const hasBalance : boolean = takerBalance . gte (
932932 ( takerAsset as UserFacingERC20AssetDataSerializedV4 ) . amount ?? 1
933933 ) ;
934+
934935 const isApproved : boolean =
935- takerApprovalStatus . tokenIdApproved ??
936- takerApprovalStatus . contractApproved ??
936+ takerApprovalStatus . contractApproved ||
937+ takerApprovalStatus . tokenIdApproved ||
937938 false ;
939+
938940 const canOrderBeFilled : boolean = hasBalance && isApproved ;
939941
940942 return {
@@ -965,8 +967,8 @@ class NftSwapV4 implements INftSwapV4 {
965967 ( makerAsset as UserFacingERC20AssetDataSerializedV4 ) . amount ?? 1
966968 ) ;
967969 const isApproved : boolean =
968- makerApprovalStatus . tokenIdApproved ??
969- makerApprovalStatus . contractApproved ??
970+ makerApprovalStatus . tokenIdApproved ||
971+ makerApprovalStatus . contractApproved ||
970972 false ;
971973 const canOrderBeFilled : boolean = hasBalance && isApproved ;
972974
Original file line number Diff line number Diff line change @@ -97,6 +97,13 @@ describe('NFTSwapV4', () => {
9797 v4Erc721SignedOrder
9898 ) ;
9999 expect ( isSignatureValid ) . toBe ( true ) ;
100+
101+ const orderStatusData =
102+ await nftSwapperMaker . checkOrderCanBeFilledMakerSide ( v4Erc721SignedOrder ) ;
103+
104+ expect ( orderStatusData . canOrderBeFilled ) . toBe ( true ) ;
105+ expect ( orderStatusData . approvalStatus . contractApproved ) . toBe ( true ) ;
106+ expect ( orderStatusData . hasBalance ) . toBe ( true ) ;
100107 } ) ;
101108
102109 it ( 'utility functions on class work properly with erc721 buy order' , async ( ) => {
@@ -142,11 +149,17 @@ describe('NFTSwapV4', () => {
142149 makerAsset ,
143150 v4Erc721SignedOrder . maker
144151 ) ;
145- expect ( makerApprovalStatus . contractApproved ) . toBe ( true ) ;
146152
147153 const isSignatureValid = await nftSwapperMaker . validateSignature (
148154 v4Erc721SignedOrder
149155 ) ;
150156 expect ( isSignatureValid ) . toBe ( true ) ;
157+
158+ const orderStatusData =
159+ await nftSwapperMaker . checkOrderCanBeFilledMakerSide ( v4Erc721SignedOrder ) ;
160+
161+ expect ( orderStatusData . canOrderBeFilled ) . toBe ( true ) ;
162+ expect ( orderStatusData . approvalStatus . contractApproved ) . toBe ( true ) ;
163+ expect ( orderStatusData . hasBalance ) . toBe ( true ) ;
151164 } ) ;
152165} ) ;
You can’t perform that action at this time.
0 commit comments