Skip to content

Commit

Permalink
feat: improved stacking lib API and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yknl committed Nov 20, 2020
1 parent 43b2886 commit 7ec3f06
Show file tree
Hide file tree
Showing 9 changed files with 810 additions and 161 deletions.
16 changes: 16 additions & 0 deletions packages/stacking/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
coverageDirectory: './coverage/',
collectCoverage: true,
globals: {
'ts-jest': {
diagnostics: {
ignoreCodes: ['TS151001'],
},
},
},
moduleFileExtensions: ['js', 'ts', 'd.ts'],
setupFilesAfterEnv: ['./tests/setup.js'],
testTimeout: 10000,
};
6 changes: 3 additions & 3 deletions packages/stacking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/auth/src/index.d.ts",
"umd:main": "dist/auth.umd.production.js",
"unpkg": "dist/auth.cjs.production.min.js",
"typings": "dist/stacking/src/index.d.ts",
"umd:main": "dist/stacking.umd.production.js",
"unpkg": "dist/stacking.cjs.production.min.js",
"gitHead": "77b4d6d531b74996e4b7a0cbd1cf5b8358a690ce"
}
21 changes: 21 additions & 0 deletions packages/stacking/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export enum StackingErrors {
ERR_STACKING_UNREACHABLE = 255,
ERR_STACKING_INSUFFICIENT_FUNDS = 1,
ERR_STACKING_INVALID_LOCK_PERIOD = 2,
ERR_STACKING_ALREADY_STACKED = 3,
ERR_STACKING_NO_SUCH_PRINCIPAL = 4,
ERR_STACKING_EXPIRED = 5,
ERR_STACKING_STX_LOCKED = 6,
ERR_STACKING_PERMISSION_DENIED = 9,
ERR_STACKING_THRESHOLD_NOT_MET = 11,
ERR_STACKING_POX_ADDRESS_IN_USE = 12,
ERR_STACKING_INVALID_POX_ADDRESS = 13,
ERR_STACKING_ALREADY_REJECTED = 17,
ERR_STACKING_INVALID_AMOUNT = 18,
ERR_NOT_ALLOWED = 19,
ERR_STACKING_ALREADY_DELEGATED = 20,
ERR_DELEGATION_EXPIRES_DURING_LOCK = 21,
ERR_DELEGATION_TOO_MUCH_LOCKED = 22,
ERR_DELEGATION_POX_ADDR_REQUIRED = 23,
ERR_INVALID_START_BURN_HEIGHT = 24,
}

0 comments on commit 7ec3f06

Please sign in to comment.