-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: getDepositInfo and getBalanceOf
- Loading branch information
1 parent
6680855
commit 9eca1fe
Showing
4 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,6 @@ | |
"lint-staged": { | ||
"*.js": "eslint --cache --fix", | ||
"*.--write": "prettier --ignore-unknown --write" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const accountAbstractionkit = require('../dist/index.umd'); | ||
require('dotenv').config() | ||
|
||
jest.setTimeout(300000); | ||
const address=process.env.PUBLIC_ADDRESS1 | ||
const jsonRpcNodeProvider=process.env.JSON_RPC_NODE_PROVIDER | ||
|
||
const entrypoints = [ | ||
"0x0000000071727de22e5e9d8baf0edac6f37da032", | ||
"0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789" | ||
] | ||
|
||
describe('deposit info and balance of address', () => { | ||
entrypoints.forEach((entrypoint) => { | ||
test('check deposit info and balance are equal and types for entrypoint: ' + entrypoint, async () => { | ||
const depositInfo = await accountAbstractionkit.getDepositInfo( | ||
jsonRpcNodeProvider, address, entrypoint); | ||
const balance = await accountAbstractionkit.getBalanceOf( | ||
jsonRpcNodeProvider, address, entrypoint); | ||
|
||
expect(depositInfo["deposit"]).toStrictEqual(balance); | ||
expect(typeof depositInfo["deposit"]).toBe("bigint"); | ||
expect(typeof depositInfo["staked"]).toBe("boolean"); | ||
expect(typeof depositInfo["stake"]).toBe("bigint"); | ||
expect(typeof depositInfo["unstakeDelaySec"]).toBe("bigint"); | ||
expect(typeof depositInfo["withdrawTime"]).toBe("bigint"); | ||
}); | ||
}); | ||
}); |