Socket
Socket
Sign inDemoInstall

@gearbox-protocol/devops

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gearbox-protocol/devops - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

3

lib/utils/balanceComparator.d.ts

@@ -11,3 +11,4 @@ import { Provider } from "@ethersproject/providers";

takeSnapshot(stage: T, holder: string): Promise<void>;
compareSnapshot(stage: T, holder: string, compareWith: string): Promise<void>;
compareSnapshots(stage: T, holder: string, compareWith: string): void;
compareAllSnapshots(holder: string, compareWith: string): void;
getBalance(stage: T, account: string, token: SupportedToken): BigNumber | undefined;

@@ -14,0 +15,0 @@ getBalanceOrThrow(stage: T, account: string, token: SupportedToken): BigNumber;

@@ -93,29 +93,13 @@ "use strict";

};
BalanceComparator.prototype.compareSnapshot = function (stage, holder, compareWith) {
return __awaiter(this, void 0, void 0, function () {
var network, _i, _a, symbol, token, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, this.getNetwork()];
case 1:
network = _c.sent();
_i = 0, _a = this._list;
_c.label = 2;
case 2:
if (!(_i < _a.length)) return [3 /*break*/, 5];
symbol = _a[_i];
token = sdk_1.IERC20__factory.connect(sdk_1.tokenDataByNetwork[network][symbol], this._provider);
_b = expect_1.expect;
return [4 /*yield*/, token.balanceOf(compareWith)];
case 3:
_b.apply(void 0, [_c.sent(), " ".concat(stage, ": different balances for ").concat(symbol)]).to.be.eq(this.getBalance(stage, holder, symbol));
_c.label = 4;
case 4:
_i++;
return [3 /*break*/, 2];
case 5: return [2 /*return*/];
}
});
});
BalanceComparator.prototype.compareSnapshots = function (stage, holder, compareWith) {
for (var _i = 0, _a = this._list; _i < _a.length; _i++) {
var symbol = _a[_i];
(0, expect_1.expect)(this.getBalance(stage, compareWith, symbol), " ".concat(stage, ": different balances for ").concat(symbol)).to.be.eq(this.getBalance(stage, holder, symbol));
}
};
BalanceComparator.prototype.compareAllSnapshots = function (holder, compareWith) {
for (var stage in this._balanceSnapshot) {
this.compareSnapshots(stage, holder, compareWith);
}
};
BalanceComparator.prototype.getBalance = function (stage, account, token) {

@@ -122,0 +106,0 @@ var _a, _b;

{
"name": "@gearbox-protocol/devops",
"version": "0.0.15",
"version": "0.0.16",
"description": "Gearbox Devops for SC development",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -44,13 +44,6 @@ import { Provider } from "@ethersproject/providers";

async compareSnapshot(stage: T, holder: string, compareWith: string) {
const network = await this.getNetwork();
compareSnapshots(stage: T, holder: string, compareWith: string) {
for (let symbol of this._list) {
let token = IERC20__factory.connect(
tokenDataByNetwork[network][symbol],
this._provider
);
expect(
await token.balanceOf(compareWith),
this.getBalance(stage, compareWith, symbol),
` ${stage}: different balances for ${symbol}`

@@ -60,3 +53,9 @@ ).to.be.eq(this.getBalance(stage, holder, symbol));

}
compareAllSnapshots(holder: string, compareWith: string) {
for (let stage in this._balanceSnapshot) {
this.compareSnapshots(stage, holder, compareWith)
}
}
getBalance(

@@ -63,0 +62,0 @@ stage: T,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc