@defisaver/sdk 1.2.9-dev-ether-fi → 1.2.10-dev-ezeth-weeth

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,60 @@
1
+ const dfs = require('../../../src');
2
+ const {getAssetInfo} = require("@defisaver/tokens");
3
+ const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
+ const {assert} = require('chai');
5
+
6
+ describe('Action: RenzoStakeAction', () => {
7
+ let action;
8
+ const from = '0x80788de454ad3681d357dc7FcB13c72333f684a7';
9
+ const to = '0x968Cc941aD9074EE687E0423a33E6f2D33d7c327';
10
+ context('Stake 100 WETH tokens without wrapping', () => {
11
+ it('constructor', () => {
12
+ const amount = 100;
13
+ action = new dfs.actions.renzo.RenzoStakeAction(
14
+ amount,
15
+ from,
16
+ to,
17
+ );
18
+ assert.equal(action.args[0], amount);
19
+ assert.equal(action.args[1], from);
20
+ assert.equal(action.args[2], to);
21
+ })
22
+ it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
23
+ it('encodeForRecipe', () => encodeForRecipe(action));
24
+ it('getEthValue', async () => {
25
+ const ethValue = await action.getEthValue();
26
+ assert.equal(ethValue, '0');
27
+ })
28
+ it('getAssetsToApprove', async () => {
29
+ const assetOwnerPairs = await action.getAssetsToApprove();
30
+ assert.lengthOf(assetOwnerPairs, 1);
31
+ assert.equal(assetOwnerPairs[0].asset, getAssetInfo('WETH').address);
32
+ assert.equal(assetOwnerPairs[0].owner, from);
33
+ })
34
+ })
35
+ context('Stake maxUint256 WETH with wrapping', () => {
36
+ it('constructor', () => {
37
+ const amount = '115792089237316195423570985008687907853269984665640564039457584007913129639935';
38
+ action = new dfs.actions.renzo.RenzoStakeAction(
39
+ amount,
40
+ from,
41
+ to,
42
+ );
43
+ assert.equal(action.args[0], amount);
44
+ assert.equal(action.args[1], from);
45
+ assert.equal(action.args[2], to);
46
+ })
47
+ it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
48
+ it('encodeForRecipe', () => encodeForRecipe(action));
49
+ it('getEthValue', async () => {
50
+ const ethValue = await action.getEthValue();
51
+ assert.equal(ethValue, '0');
52
+ })
53
+ it('getAssetsToApprove', async () => {
54
+ const assetOwnerPairs = await action.getAssetsToApprove();
55
+ assert.lengthOf(assetOwnerPairs, 1);
56
+ assert.equal(assetOwnerPairs[0].asset, getAssetInfo('WETH').address);
57
+ assert.equal(assetOwnerPairs[0].owner, from);
58
+ })
59
+ })
60
+ })