Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: RequestLogicTypes.CURRENCY.ETH,
value: 'ETH',
},
expectedAmount: '100000000000',
payee: signerIdentity,
payer: {
type: IdentityTypes.TYPE.ETHEREUM_ADDRESS,
value: '0x740fc87Bd3f41d07d23A01DEc90623eBC5fed9D6',
},
};
// Signature provider setup
const signatureProvider = new EthereumPrivateKeySignatureProvider(signatureInfo);
// Advanced logic setup
const advancedLogic = new AdvancedLogic();
/**
* Sets up the test environment: instantiate the layers, including a mock storage
*
* @returns {Promise}
*/
async function setup(): Promise<{ mockStorage: MockStorage; requestLogic: RequestLogic }> {
const mockStorage = new MockStorage();
// Data access setup
const dataAccess = new DataAccess(mockStorage);
await dataAccess.initialize();
// Logic setup
return {
mockStorage,
public constructor(
dataAccess: DataAccessTypes.IDataAccess,
signatureProvider?: SignatureProviderTypes.ISignatureProvider,
decryptionProvider?: DecryptionProviderTypes.IDecryptionProvider,
bitcoinDetectionProvider?: Types.IBitcoinDetectionProvider,
) {
this.advancedLogic = new AdvancedLogic();
this.transaction = new TransactionManager(dataAccess, decryptionProvider);
this.requestLogic = new RequestLogic(this.transaction, signatureProvider, this.advancedLogic);
this.contentData = new ContentDataExtension(this.advancedLogic);
this.bitcoinDetectionProvider = bitcoinDetectionProvider;
}
public constructor(
dataAccess: DataAccessTypes.IDataAccess,
signatureProvider?: SignatureProviderTypes.ISignatureProvider,
) {
this.advancedLogic = new AdvancedLogic();
this.transaction = new TransactionManager(dataAccess);
this.requestLogic = new RequestLogic(this.transaction, signatureProvider, this.advancedLogic);
this.contentData = new ContentDataExtension(this.advancedLogic);
}