Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added fungify low liquidity notification #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions _test/test-fungify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const Web3 = require('web3');
const web3 = new Web3(new Web3.providers.HttpProvider(require('./dev-keys.json').web3));

async function testFungifyLowHealth(address) {
const LowHealth = require('../fungify/low-liquidity');
const lowHealth = new LowHealth();

// simulate init event
await lowHealth.onInit({
web3
});

// simulate on blocks event
const form = await lowHealth.onSubscribeForm({address});

console.log(form);

return lowHealth.onBlocks({
web3,
subscription: {
minLiquidity: '10'
},
address: address
});
}


async function main() {

console.log('Running manual test:');

const address = '';

console.log(await testFungifyLowHealth(
address
));

}

main();
Loading