Skip to content

Commit

Permalink
fix: optimize hardware example (#392)
Browse files Browse the repository at this point in the history
* fix: optimize hardware example

* fix: fix passphrases & mnemonicAddress

* fix: remove source map loader

* fix: eslint fix
  • Loading branch information
wabicai committed Jan 17, 2025
1 parent 9c7ac94 commit 2d05c39
Show file tree
Hide file tree
Showing 37 changed files with 370 additions and 30 deletions.
5 changes: 2 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": [
"wesbos/typescript"
],
"extends": ["wesbos/typescript"],
"env": {
"jest": true
},
"root": true,
"plugins": ["jest"],
"rules": {
"no-console": "off",
Expand Down
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# Run tests
yarn test

# Run lint:fix
yarn lint:staged

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ const testCase: MnemonicAddressTestCase = {
hrp: 'osmosis',
},
},
{
id: 'benfenGetaddress',
method: 'benfenGetaddress',
},
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,8 @@ export const baseParams = {
path: `m/44'/195'/0'/0/${INDEX_MARK}`,
showOnOneKey: false,
},
benfenGetAddress: {
path: `m/44'/728'/${INDEX_MARK}'/0'/0'`,
showOnOneKey: false,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -562,5 +562,15 @@ export default {
'2147483647': 'TBnXbdxn35DuECbDdr2uppdTYDHJLSGA3h',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCdd98e1e3b1d9e019c82374bc82bc6b5d653d0bcbb1eb1bfccd8d25ddd6f83a5db214',
'1': 'BFC92f4902024981228033ed15b26cdc6930fcf319c14ad0e95edd25bfde0d172d70569',
'25': 'BFC40c1e4c622c3356845bb9f2eee09aefb5261ebfc1e16fa7590cb1c1057b6582bcb41',
'2147483646': 'BFCab460b81e58239d806fb671bc7700e7142b61c6500fccae190e8dc8174587dac197f',
'2147483647': 'BFC5ff2b3a34047f48caad8962a5a1baf237953db19e4b6c6867fe6994c078d8443e735',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TTpd2BUBaCuMqHtBhTCJe9dgXVnHBtbqXf',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCf0544bfaea4439a347834b19f513ba833083715d1904e4ddd37f7af8b1736cd50a0a',
'1': 'BFCe6d2d32fc97c3bede6215d069e6fd33fe11c1dbc7894727eff9a18516480dfbddcf2',
'25': 'BFCa9e0144e421bea592796f99e34e3edb555bdc5f3848870cc4f05cc0fca8768b1f1ac',
'2147483646': 'BFC87c31999cb11b361372198e60e5d39509767d48c79db65efacb805b83822848cf21d',
'2147483647': 'BFCbfccaaa7c3e488af03164d2d7d1a20cc2ee7a008505d36bd60b74ad70c4588569018',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TUKjDFGmLHw6NLbYuy4bpt2d6MBpKYtiYR',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC1c5404fc4c215d1f9d0630c61691b588bbd88fd4a2bcdc2fd74689720bb6cfb84820',
'1': 'BFCff2d2498ce365a4ba6b5e90edf54bb174798540493c15af1910375d958f1ddf8f3f4',
'25': 'BFC7774cf91db3f17c19ccb8783654191c2519a7041057ca5c5aaa192c715a3018dbec3',
'2147483646': 'BFCf0960edd2ef00bd36e6b4190d1cd8e98ad4a37a90fe1ec7ef8964b223cda3a6d50fd',
'2147483647': 'BFC28834bfc0be1b5eed1583b814fb4a698e56850ce3a603eafbd91c57542b6f17ec0f6',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TLJQqC8iAMVXsCDZxqSraTTFz7KU9CvfTx',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC5996d4c6a609a4046a55de8cf69adc17b3d8b34eea8fe908a684df69f8d238c4c57f',
'1': 'BFCfd971b4be078ba5a8fbdfedbd9683dbc637ce70f90b29c05510b90cc12ba71174654',
'21234567': 'BFC0751e3c028b24b6f0468ec1d4a6ca8faac3dfe902990eab63b2554bfa4a21efe06e6',
'2147483646': 'BFC451eb6959283fb3e7e1815e3e82d12c54029f8894129c15b9643fc3ff17d63144e58',
'2147483647': 'BFC6552ce65776890a22cd85d878a18dc3bfbcd0475433d63fe4f6e48ab3d62144dd16a',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TS8C5VCCCR83yqRvrLx2sj23k9EHsnbnC6',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCc3f6d4edd2c00125fb4aeb58c54d1b06626b685bf1be2a16a600e29713a2f67ea7e8',
'1': 'BFCc1f9138bdc1d03cc47ab9cc909c6ec704b09444ee7610dedd0ed0dd7a39f4869596b',
'21234567': 'BFCa16113164db28e788422fb265dc08ae0a30b647602714f59da188c024a392d396fe6',
'2147483646': 'BFC8ff609bf6e3b87965f4d2e8dd3f57d19d4c65ad71133c4e7a8348bade49c0f695831',
'2147483647': 'BFC5b8bdd12050906421fde23d116e702f0dbd6362c92f4b0e77a3b227fba2ac2475439',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TZGDfP18VzGXFseZzF4LAgKrEXXBvhmbXb',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC9a7a4db1fa7347ad924fdce215badaef6f0d03717a3c0dc68e85a006fb137aea325d',
'1': 'BFC97c73d847bc5d544988e5f5667d86d42660111f1ade5606b2453d19f57fbda1142b7',
'21234567': 'BFC5fad91679c71ef7e4514164bef941bfc042034b479c980cf480eb71f3edef66c5d36',
'2147483646': 'BFC1208c96e3a449aa4c2d704152d08df20b75d6e1c27750f4d9dc69dc1d7298b18ffbf',
'2147483647': 'BFCa893f9639eb206c4631e2edbcb23e24a1d3cf0ff5f9391c821c59e99129262a79052',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TPu6YTHSMkUtLvh1Rs6k47NtTx1c1JyLhY',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC54b56e9154ddfef6b5c24cd3dc6c27d47e4ca0009aff7539de26e9a29b39082bdf53',
'1': 'BFCd7390848080ed9eb8abf26b8a7fc1642362747e44dbf0ec7ba21b8a6a81ab772baaf',
'35': 'BFCc5bb39f5af2d76c1a856fbab810f47fd8099db3c038e0ab8cf8e27bb1a4212bce39d',
'2147483646': 'BFCa49bf90d5deaf2376e80540029f27107fae8435f982ac7c2e0e054df4b1321c70a2f',
'2147483647': 'BFC914ac4146474c24667b2ce5fc6d32e3b81903e0554244c84fcac804531c63cb61d2b',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TEePSjxw7nRVSK1h7UomM3EemD2XDNtrWu',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCa32b60d9a0b34ef459fa7793ab9f5aed9612938685125e35a9108edaa407079f5705',
'1': 'BFC4e45a44f602b492fe9911d05a244005f552e453c3ae23662cec070c2d95d10a9cad0',
'35': 'BFC65b4573af540203ec787e89b83f9109967087ebef6fa0b7dcf09aa76db30e3d4d8cc',
'2147483646': 'BFC8de6066df665b2db260a04f9a1e62a8cdc13d1adb726da3f5367f02d1dde1c8e053c',
'2147483647': 'BFCe1c2bbeb28573fcbe001d1406395eda3b942d51bcc3f914b8272f120e58388b0dd50',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TTXTCwxbw4VJ65Exq9mWsARPP5FMmnuRGD',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC1541833f3508db54b734dadffffe5008d55bc970ed7c3e07d1927bec53fd08b58a62',
'1': 'BFC8408d30e070805c12cd7bb6e4576786f4220fa36e9e46442a00f5b9cabb286d0ae37',
'35': 'BFCab52788ef7ea21c51ff832d84eba25170d1876a23950d3cf744a4e02c406085b5736',
'2147483646': 'BFCc242e3886a5a7914e966fbe228b27fd4619016d27c2836adf9ff5865919cb35f7ea9',
'2147483647': 'BFCfc09750a594f84e6added92ba364e3ff0f52a1fb3533313f6e02870c34015c3ae9f0',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TAaHzHQ54vL3L1TeGNpRxNZiH5KJZRtPUn',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCee6a5283888f7f7c46e358dbd1fe92a8a02b1e8a21707628c4dd70bd38555e1a7897',
'1': 'BFC124d4767cc262b4d0e65ddc8e4eca0e0d7d17757d7410f1356caa14ced4c38d3c685',
'100': 'BFCed5c785d7acc5deae1fc13891d179439f507cbd273e9c1a449dc7d842fa17db8b6fa',
'2147483646': 'BFC6e40b1acb326f3940feba6bb4a9bc4dda53f3d2baee7c4766b9498b5794d457af99e',
'2147483647': 'BFCc566b7a58c668e33cde4e5955758b34f2a11333062224fb7f8d4e9c11d365d768548',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TP3cQWgbq2kopNkXHjHDvJXGo6a15j3zmi',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC5a6464236476bf2bedd6eba0629d83aa0f7c8ce74e51733a8b1f20081fc279ef66b0',
'1': 'BFC8c9f9d4cf8c9828379c0744d68b0d3478b17989e42d9d80aab0bd0a66f4f93dda2b8',
'100': 'BFCfca709d9c44629f4a9a1b6b5c9458b3735c4fc8b872ff36a6f32325550725aac4a6a',
'2147483646': 'BFCd136df3783e0902d4673bcaf51911eb326be16cde4941e624da998d75f72641d0882',
'2147483647': 'BFC702b092829741fd123e5054168f66ca53b19aa6ed626e84b3d3f1489889b98fcf33e',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,15 @@ export default {
'2147483647': 'TXY2yvcT2aJHiyMk5iyjp2UrvcbtDLDZ8w',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC83f730a437993aeef2583c40590f7fed5e7a0e12b4ff5fdda7a45573a67fc6c61a67',
'1': 'BFC73778847fba09d97951d1f7abe30c134d17c53eac8a0cd3db9ba008a39c2c45e8c84',
'100': 'BFCe3404af3aa3a5d3985cf544f8795c817dafe92e3036f19deae2aa7402e1b33ec58f8',
'2147483646': 'BFCac0d5396b5bfeff5477a74dbfe1ef56c74487801adedf05d94a05530c2a45f5a3eda',
'2147483647': 'BFCff18b9e9a501e044569d86db9bfed749c6ebd776d23b3d8790039eee4a60aca1f946',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TBzaCCL1tFkncWwMdvgiC9R1V76VW59pEB',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC40f466801bd4c9e98e46898c1ae72474fa12ba931ab65c6628515c35873427620469',
'1': 'BFC01aae53e15ee0b50510ba2e1e73aa41f44893d9a0825b67c25444524c1ced8ff0655',
'30': 'BFCe2c14591424f3295f38f4479ceb976b815a4f54e29551b80d0c126b66ef1b8f964dc',
'2147483646': 'BFC5e9e1b64c4b1b95c9dc01ed72fb350fcbf4c30b90262bf3a06d5adbb308c7e386779',
'2147483647': 'BFC6cc46b63073b89b96499a43c3b78826260ea41df042ecd3101f4240e7193fea42fc5',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TBuVXCRn5o2aKHr5TdMvF9FW2vPtuh5Zt1',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC69cb6a70063f981a57103c76a423b8f4fecc37bf56c813b16a88acb4bb2257b8a0e0',
'1': 'BFCf17e507399aff90e272df0f2a7cf7be774bc4e1c35f4459696061ea4e1f13c8dd0b8',
'30': 'BFC2b7b8a95b25dd93002aa951b3b3446d257c7edba2ba868025ec3630eaba4146b3f01',
'2147483646': 'BFC61825bd07fdf7818e07b8fba1e42323a0582e16d7b4b1b9d15bcdb0ecd8638c8a6b9',
'2147483647': 'BFCed94a37303493de54a50f3923b7e7bdc393fdeb010f9321b4fd84ca0222a5c72cdcf',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TRHTunHUuBLnu9VQWmjmAWVaYkX2urbxSm',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC30f7e71df92d63d524e98aea15a106a63f5f18223776a1e810b0fb4327d99b8dd101',
'1': 'BFC0ed930f0c49924d6e4f62880a474f03f3bd4d60a20424f5b6e80fd0d387018b22894',
'30': 'BFCada2b8aec4f0f561bc86b5646bd65d80444dc25538eb8d4c93ca4e6bc1d41ac96865',
'2147483646': 'BFC085052bc29615c966efbca4f04e7b8af6419558f9af817af186a2ddfe3bbd37fd46b',
'2147483647': 'BFC29185aca50b33e1f65b562df6892f2c2c2b85ded61bf8cdba13d05d829bf521f2719',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TUDLQpX75UCku4vCAYccj29GC563dH33bZ',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC6e8c7669699bbafdaeec84c45d67c7609370b451b1ffd3a558b365afa9993ac710fd',
'1': 'BFC647a389509d9d5dda09c4589b1fcb1c27939107f205e6d47fddf01604c779bd697c5',
'30': 'BFC065be1986b4f63876ca30a7daedf53fcea31e9716e86b455789199ef1ab0c46c908f',
'2147483646': 'BFC82327c80577de309ad9db82fe8fef7ed63fa4251c6748ce322051df9214fa7b9f86d',
'2147483647': 'BFC4ab98edf626afd04d154cd96bf21b0dd94dd9427cc77ffa1af15f09e6e56727c2e6e',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TCMV5P7heGwMHpNVkog4Lp2nuAaLLaWN7m',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCa75c4c5ddcd017834182027275c26fca46352656c90728420d28572c95230a4ca657',
'1': 'BFC9b4847215d382925f86f3b7267938d6c8b758cbc88b2508863ac15bcfb1af7697dcf',
'30': 'BFCa01b41114a135a7052e3b864f74e1a2adf83cc20ce07ab5a2cc0e966a0d746687bd3',
'2147483646': 'BFC54bc2f7d6d9786700bd2f70aeb2124cb4fae317a4753e191a55a72678995b728edc9',
'2147483647': 'BFC7331a87c101f58a34570795119d21d12458fe41dd33be20c12568c0fcaa1cf14fc60',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'THdRd5GWRMpf32ZnYKmPo1s2yJMvxPBmF9',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC97c42f5a908e5c83400e4ff8773eb51ac04429cad5ea9f9b120da1b5d53292745bf2',
'1': 'BFC5f6bc37eef82eb31bfd4034e39951db4cf88d6473767f75a4e0c72cc6ed7477e79d1',
'30': 'BFCf4d6422ef88f266b16167f701ebcef3b585f864d051e1717a4e10eada45a85158a1e',
'2147483646': 'BFC2647af48534dc90414821a9966b82349b3efe3adbf4f4e32ad9942da0750dc9b066c',
'2147483647': 'BFC77f256580e81bf98f4bc922e97db12c2d7a236d659029a8e82a27525ea400988f458',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TSwbjougp8YbQj68kNFRdtnsXcwmc3GZmp',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCf7180c8ab5c320dfce5d3632782035120af4f841071acccebb38e35bbf8c583f5ca6',
'1': 'BFCee22a51a0c4ee53c595b198baba1338e56035873eb9459db39dc26ba4fd0de8877c7',
'10': 'BFC24c71ca4ad2263f0be2ae79c64992536c47bfb0198126df543f1870b7a4f93845c2d',
'2147483646': 'BFCb1a7b539b6f92be4b0f6905a63bcf3d6ab84b244503528cfe33cbf164bcc7fe646f3',
'2147483647': 'BFCf3c6f566a5fc4bde7674bd9cbfd6cdd5c7e199fa1cbe65e461a21ef6a68df76a3ff5',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TS9XAR3tKoiGMdDJm6ijVCgdvt6SmTLbJY',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCcd484bb0ba4124e9807036bd75d061747fdf3ae354c88a5ca5e376d41c0076a0fc4b',
'1': 'BFC7b7e6512f23b452be033c83ddc5e117bebf7d68d65b69dce9ddeba6eba24edfb1ded',
'10': 'BFCb129cc97a1064ce0f12074af5b4bb5ff372e005e0c5e8cb2aa15da326b3d3af8ed59',
'2147483646': 'BFC88fbab6fad925c6f49ff010d8108849f4fa8d5fabb9d8a58188dbc08fdd0a7019bc8',
'2147483647': 'BFC07d877cc034c72b678d8cb9d0f8221138b70435e6ef31bc50610e478dcd41216fcbc',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TWFjr4of4Zc9QdFjNiksWpmTkfb3f7wSvF',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFC3b9ac1cd4a3b45b12ef6f9f1d8725f64ce816cd077593891bc9da30db09212d09fbf',
'1': 'BFC8be3cfc82fb0b818dfb7a276d30436e30ae76f600b9664ad09deb767bf6fbefa9420',
'10': 'BFC6aed3d7f0377d7f644e8ef59897c7e805ac4f5012ac064e814c85b30f6a6d1c2417d',
'2147483646': 'BFC9146b417b0a161b53ccb36597b9319af663860a0c5f2fbdc6b773cc1d545d06cfd36',
'2147483647': 'BFC0fff21df0a8cfc8314128c751ba14aa24674837dd3e929946cae1f4a3aaa14592036',
},
},
],
} as AddressTestCaseData;
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,15 @@ export default {
'2147483647': 'TZBvNVzxT5vVH9HPMYS9XBBTaH8qJZnDv1',
},
},
{
method: 'benfenGetAddress',
expectedAddress: {
'0': 'BFCd249c6e9952b34e340790036c5a88cbe20a073ad0a30b2ff0cec1454cb50ddfe448d',
'1': 'BFCbc42e9b7df88ad8f21348ca3fb4e3331a8cd1a106cf2a25e3661e96a27b67f53cf9e',
'50': 'BFCdfe80d60fd9ac32af434e2e189533048c01dbf548a388ece8d6747f0a89c1cc786c4',
'2147483646': 'BFC0107f5de1176bb285962dd7fe9972c4fb76a81de38f3ed008dfaf4815f4a711133f2',
'2147483647': 'BFC46b509433b912ad94b3de282ff7f125a490eebe657ddb8cc431ae528d69a25e39472',
},
},
],
} as AddressTestCaseData;
Loading

0 comments on commit 2d05c39

Please sign in to comment.