Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions modules/express/src/expressApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ function checkPreconditions(config: Config) {
config.env = 'custom';
}

if (env !== 'test' && (externalSignerUrl !== undefined || signerMode !== undefined)) {
throw new ExternalSignerConfigError('external signer feature is only enabled for test mode.');
}

if (externalSignerUrl !== undefined && (signerMode !== undefined || signerFileSystemPath !== undefined)) {
throw new ExternalSignerConfigError(
'signerMode or signerFileSystemPath is set, but externalSignerUrl is also set.'
Expand Down
27 changes: 0 additions & 27 deletions modules/express/test/unit/bitgoExpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,32 +464,5 @@ describe('Bitgo Express', function () {
(() => expressApp(args)).should.not.throw();
readValidStub.restore();
});

it('should require express to be in test mode when using the external signer feature', function () {
const readValidStub = sinon.stub(fs, 'readFileSync').returns(validPrvJSON);

const args: any = {
env: 'notTestMode',
signerMode: 'signerMode',
signerFileSystemPath: 'signerFileSystemPath',
};
(() => expressApp(args)).should.throw({
name: 'ExternalSignerConfigError',
message: 'external signer feature is only enabled for test mode.'
});

args.signerMode = undefined;
args.signerFileSystemPath = undefined;
args.externalSignerUrl = 'externalSignerUrl';
(() => expressApp(args)).should.throw({
name: 'ExternalSignerConfigError',
message: 'external signer feature is only enabled for test mode.'
});

args.env = 'test';
(() => expressApp(args)).should.not.throw();

readValidStub.restore();
});
});
});