Skip to content

Commit 7ba15cc

Browse files
author
chenf
committed
Add update
1 parent 2d3e4db commit 7ba15cc

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

test/deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const { expect } = require('chai');
22
const { deploy } = require('../scripts/deploy.js');
33
const { toBigInt, toDecimal, showReceipt, snd, tableSnd, d1, Vc, Vp, UI } = require('./utils.js');
44

5-
describe('NestOpenMining', function() {
5+
describe('deploy', function() {
66
it('First', async function() {
77
var [owner, addr1, addr2] = await ethers.getSigners();
88

9-
await deploy();
9+
const { nest, usdt, hbtc, cofi, usdc, nestBatchMining } = await deploy();
1010
console.log('ok');
1111
});
1212
});

test/update.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const { expect } = require('chai');
2+
const { deploy } = require('../scripts/deploy.js');
3+
const { toBigInt, toDecimal, showReceipt, snd, tableSnd, d1, Vc, Vp, UI } = require('./utils.js');
4+
5+
describe('update', function() {
6+
it('First', async function() {
7+
var [owner, addr1, addr2] = await ethers.getSigners();
8+
9+
const { nest, usdt, hbtc, cofi, usdc, nestBatchPlatform2 } = await deploy();
10+
console.log('ok');
11+
12+
{
13+
const config = await nestBatchPlatform2.getConfig();
14+
console.log(UI(config));
15+
16+
const ci = await nestBatchPlatform2.getChannelInfo(0);
17+
console.log(UI(ci));
18+
19+
// await nestBatchPlatform2.modifyToken(0, 0, '0x102E6BBb1eBfe2305Ee6B9E9fd5547d0d39CE3B4');
20+
// await nestBatchPlatform2.modify(0, {
21+
// rewardPerBlock: 20000000000000000000n,
22+
// postFeeUnit: 0,
23+
// singleFee: 0,
24+
// reductionRate: 8000
25+
// });
26+
27+
// // Price channel configuration
28+
// struct ChannelConfig {
29+
30+
// // Reward per block standard
31+
// uint96 rewardPerBlock;
32+
33+
// // Post fee(0.0001eth, DIMI_ETHER). 1000
34+
// uint16 postFeeUnit;
35+
36+
// // Single query fee (0.0001 ether, DIMI_ETHER). 100
37+
// uint16 singleFee;
38+
39+
// // Reduction rate(10000 based). 8000
40+
// uint16 reductionRate;
41+
// }
42+
}
43+
44+
{
45+
const config = await nestBatchPlatform2.getConfig();
46+
console.log(UI(config));
47+
48+
const ci = await nestBatchPlatform2.getChannelInfo(0);
49+
console.log(UI(ci));
50+
}
51+
});
52+
});

0 commit comments

Comments
 (0)