@@ -433,17 +433,6 @@ describe('BlockstackService tests', () => {
433433 json : true ,
434434 strictSSL : false
435435 }
436- it ( 'if uploadToGaiaHub breaks, should raise "GaiaProfileUploadFailed"' , async ( ) => {
437- uploadToGaiaHubStub . onCall ( 0 ) . throws ( 'unhandled in mocks' )
438- let raisedError
439- try {
440- await blkstkService . registerName ( sampleIdentityClaim , sampleSubdomain )
441- } catch ( error ) {
442- raisedError = error
443- }
444- expect ( raisedError . errorCode ) . to . be . equal ( errors . PackageErrorCode . GaiaProfileUploadFailed )
445- expect ( uploadToGaiaHubStub . calledOnce ) . is . true
446- } )
447436
448437 it ( 'given valid identityClaim and a non-registered cruxId (bob@devcoinswitch.crux), should successfully register and return the fullCruxId' , async ( ) => {
449438 let registeredName = await blkstkService . registerName ( sampleIdentityClaim , desiredName )
@@ -453,16 +442,13 @@ describe('BlockstackService tests', () => {
453442 expect ( registeredName ) . is . equal ( expectedRegisteredName )
454443 } )
455444 it ( 'given valid identityClaim and a registered cruxId, should throw "SubdomainRegistrationFailed"' , async ( ) => {
456- uploadToGaiaHubStub . resolves ( "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/cruxpay.json" )
457445 let raisedError
458446 try {
459447 await blkstkService . registerName ( sampleIdentityClaim , sampleSubdomain )
460448 } catch ( error ) {
461449 raisedError = error
462450 }
463- expect ( uploadToGaiaHubStub . calledOnce ) . is . true
464- // expect(httpJSONRequestStub.calledOnce).is.true
465- expect ( uploadToGaiaHubStub . calledWith ( 'profile.json' ) ) . is . true
451+ expect ( httpJSONRequestStub . calledOnce ) . is . true
466452 expect ( httpJSONRequestStub . calledWith ( redundantRegistrarRequestOptions ) ) . is . true
467453 expect ( raisedError . errorCode ) . to . be . equal ( errors . PackageErrorCode . SubdomainRegistrationFailed )
468454 } )
@@ -492,7 +478,7 @@ describe('BlockstackService tests', () => {
492478 it ( 'given valid identityClaim and valid addressMap, should resolve the promise without errors' , async ( ) => {
493479 // mocked values
494480 connectToGaiaHubStub . resolves ( { "url_prefix" : "https://gaia.cruxpay.com/" , "address" : "1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ" , "token" : "v1:eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJnYWlhQ2hhbGxlbmdlIjoiW1wiZ2FpYWh1YlwiLFwiMFwiLFwic3RvcmFnZTIuYmxvY2tzdGFjay5vcmdcIixcImJsb2Nrc3RhY2tfc3RvcmFnZV9wbGVhc2Vfc2lnblwiXSIsImh1YlVybCI6Imh0dHBzOi8vaHViLmJsb2Nrc3RhY2sub3JnIiwiaXNzIjoiMDJiYzljM2Y4ZTkyNGI3ZGU5MjEyY2ViZDAxMjlmMWJlMmU2YzNmMjkwNGU5MTFiMzA2OThiZGU3N2JlNDg3OGI4Iiwic2FsdCI6ImE0ODk1ZWE1ZjdjZjI2N2VhNDEwMjg2ZjRjNzk4MTY3In0.QFuEEVijDYMKHjERaPA_YXwnwWoBq8iVg4pzEusP0S_u5jSmmxqeJcumyMK8cqT4NTmOYgnMUC4u4-9OAUWOIQ" , "server" : "https://hub.cruxpay.com" } )
495- uploadToGaiaHubStub . resolves ( "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/cruxpay .json" )
481+ uploadToGaiaHubStub . resolves ( "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/devcoinswitch_cruxpay .json" )
496482
497483 // initialising the nameservice
498484 let bs = new blockstackService . BlockstackService ( nameservice_options )
@@ -561,7 +547,7 @@ describe('BlockstackService tests', () => {
561547 url : '/v1/names/cs1.devcoinswitch_crux.id' ,
562548 json : true
563549 }
564- let gaiaRequestOptions = { method : "GET" , url : "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/cruxpay .json" , json : true }
550+ let gaiaRequestOptions = { method : "GET" , url : "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/devcoinswitch_cruxpay .json" , json : true }
565551
566552 it ( 'given registered cruxId (sanchay@devcoinswitch.crux), which does not have pulic addressMap should throw "GaiaCruxPayGetFailed"' , async ( ) => {
567553 let raisedError
@@ -591,7 +577,7 @@ describe('BlockstackService tests', () => {
591577 expect ( raisedError . errorCode ) . to . be . equal ( errors . PackageErrorCode . UserDoesNotExist )
592578 } )
593579 it ( 'given registered cruxId, which has not made addresses public, should throw "GaiaEmptyResponse"' , async ( ) => {
594- let gaiaRequestOptions = { method : "GET" , url : "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/cruxpay .json" , json : true }
580+ let gaiaRequestOptions = { method : "GET" , url : "https://gaia.cruxpay.com/1HtFkbXFWHFW5Kd4GLfiRqkffS5KLZ91eJ/devcoinswitch_cruxpay .json" , json : true }
595581 let response = "<Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.RequestId:299c4c0b-701e-0066-67df-7d085b000000Time:2019-10-08T13:54:51.8653868Z</Message></Error>"
596582 httpJSONRequestStub . withArgs ( gaiaRequestOptions ) . returns ( response )
597583 let raisedError
@@ -608,16 +594,12 @@ describe('BlockstackService tests', () => {
608594 it ( "given filename, returns upload package error code" , async ( ) => {
609595 let fileNameCruxPay = UPLOADABLE_JSON_FILES . CRUXPAY
610596 let fileNameClientConfig = UPLOADABLE_JSON_FILES . CLIENT_CONFIG
611- let fileNameProfile = UPLOADABLE_JSON_FILES . PROFILE
612597
613598 let cruxPayStatus = blockstackService . BlockstackService . getUploadPackageErrorCodeForFilename ( fileNameCruxPay )
614599 expect ( cruxPayStatus ) . to . be . equal ( errors . PackageErrorCode . GaiaCruxPayUploadFailed )
615600
616601 let clientConfigPayStatus = blockstackService . BlockstackService . getUploadPackageErrorCodeForFilename ( fileNameClientConfig )
617602 expect ( clientConfigPayStatus ) . to . be . equal ( errors . PackageErrorCode . GaiaClientConfigUploadFailed )
618-
619- let profileStatus = blockstackService . BlockstackService . getUploadPackageErrorCodeForFilename ( fileNameProfile )
620- expect ( profileStatus ) . to . be . equal ( errors . PackageErrorCode . GaiaUploadFailed )
621603 } )
622604 } )
623605
0 commit comments