File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -860,17 +860,23 @@ class NftSwapV4 implements INftSwapV4 {
860860 * @param signedOrder A 0x v4 signed order to validate signature for
861861 * @returns
862862 */
863- validateSignature = async ( signedOrder : SignedNftOrderV4 ) => {
863+ validateSignature = async (
864+ signedOrder : SignedNftOrderV4
865+ ) : Promise < boolean > => {
864866 if ( 'erc721Token' in signedOrder ) {
865- return this . exchangeProxy . validateERC721OrderSignature (
867+ // Validate functions on-chain return void if successful
868+ await this . exchangeProxy . validateERC721OrderSignature (
866869 signedOrder ,
867870 signedOrder . signature
868871 ) ;
872+ return true ;
869873 } else if ( 'erc1155Token' in signedOrder ) {
870- return this . exchangeProxy . validateERC1155OrderSignature (
874+ // Validate functions on-chain return void if successful
875+ await this . exchangeProxy . validateERC1155OrderSignature (
871876 signedOrder ,
872877 signedOrder . signature
873878 ) ;
879+ return true ;
874880 } else {
875881 throw new Error ( 'Unknown order type (not ERC721 or ERC1155)' ) ;
876882 }
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ describe('NFTSwapV4', () => {
9292 v4Erc721SignedOrder . maker
9393 ) ;
9494 expect ( makerApprovalStatus . contractApproved ) . toBe ( true ) ;
95+
96+ const isSignatureValid = await nftSwapperMaker . validateSignature (
97+ v4Erc721SignedOrder
98+ ) ;
99+ expect ( isSignatureValid ) . toBe ( true ) ;
95100 } ) ;
96101
97102 it ( 'utility functions on class work properly with erc721 buy order' , async ( ) => {
@@ -138,5 +143,10 @@ describe('NFTSwapV4', () => {
138143 v4Erc721SignedOrder . maker
139144 ) ;
140145 expect ( makerApprovalStatus . contractApproved ) . toBe ( true ) ;
146+
147+ const isSignatureValid = await nftSwapperMaker . validateSignature (
148+ v4Erc721SignedOrder
149+ ) ;
150+ expect ( isSignatureValid ) . toBe ( true ) ;
141151 } ) ;
142152} ) ;
You can’t perform that action at this time.
0 commit comments