Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hive/wax
1 result
Show changes
Commits on Source (6)
Subproject commit 05d5ff95f9415083aaf95b70349beb73abe7962d
Subproject commit 824b7c295687c50a49e412aceb7a14f834927a1e
......@@ -97,7 +97,7 @@
"typescript": "catalog:typescript-toolset"
},
"dependencies": {
"@hiveio/beekeeper": "1.27.9-stable.250219154236",
"@hiveio/beekeeper": "1.27.10-stable.250305202831",
"events": "^3.3.0",
"long": "^5.2.3"
},
......
......@@ -7,71 +7,71 @@ settings:
catalogs:
husky:
husky:
specifier: 8.0.3
specifier: 9.1.5
version: 8.0.3
playwright-toolset:
'@playwright/test':
specifier: ^1.50.1
specifier: 1.50.1
version: 1.50.1
http-server:
specifier: ^14.1.1
specifier: 14.1.1
version: 14.1.1
playwright:
specifier: ^1.50.1
specifier: 1.50.1
version: 1.50.1
proto-toolset:
protobufjs:
specifier: ^7.2.5
specifier: 7.2.5
version: 7.2.5
ts-proto:
specifier: ^1.172.0
specifier: 1.172.0
version: 1.172.0
rollup-toolset:
'@rollup/plugin-commonjs':
specifier: ^27.0.0
specifier: 27.0.0
version: 27.0.0
'@rollup/plugin-node-resolve':
specifier: ^15.3.1
specifier: 15.3.1
version: 15.3.1
'@rollup/plugin-replace':
specifier: ^6.0.2
specifier: 6.0.2
version: 6.0.2
rollup:
specifier: 4.24.0
version: 4.24.0
rollup-plugin-copy:
specifier: ^3.5.0
specifier: 3.5.0
version: 3.5.0
rollup-plugin-dts:
specifier: ^6.1.1
specifier: 6.1.1
version: 6.1.1
size-limit-toolset:
'@size-limit/file':
specifier: ^11.1.6
specifier: 11.1.6
version: 11.1.6
size-limit:
specifier: ^11.1.6
specifier: 11.1.6
version: 11.1.6
terser:
terser:
specifier: ^5.39.0
specifier: 5.39.0
version: 5.39.0
typedoc-toolset:
typedoc:
specifier: 0.27.3
version: 0.27.3
typedoc-gitlab-wiki-theme:
specifier: ^2.1.0
specifier: 2.1.0
version: 2.1.0
typedoc-plugin-markdown:
specifier: 4.3.1
version: 4.3.1
typescript-toolset:
tslib:
specifier: ^2.8.1
specifier: 2.8.1
version: 2.8.1
tsx:
specifier: ^4.19.2
specifier: 4.19.2
version: 4.19.2
typescript:
specifier: 5.7.3
......@@ -82,8 +82,8 @@ importers:
.:
dependencies:
'@hiveio/beekeeper':
specifier: 1.27.9-stable.250219154236
version: 1.27.9-stable.250219154236
specifier: 1.27.10-stable.250305202831
version: 1.27.10-stable.250305202831
events:
specifier: ^3.3.0
version: 3.3.0
......@@ -351,8 +351,8 @@ packages:
'@gerrit0/mini-shiki@1.24.4':
resolution: {integrity: sha512-YEHW1QeAg6UmxEmswiQbOVEg1CW22b1XUD/lNTliOsu0LD0wqoyleFMnmbTp697QE0pcadQiR5cVtbbAPncvpw==}
'@hiveio/beekeeper@1.27.9-stable.250219154236':
resolution: {integrity: sha1-6fL+OgTwp6MSp0Xm3fwj+kFLzD8=, tarball: https://gitlab.syncad.com/api/v4/projects/198/packages/npm/@hiveio/beekeeper/-/@hiveio/beekeeper-1.27.9-stable.250219154236.tgz}
'@hiveio/beekeeper@1.27.10-stable.250305202831':
resolution: {integrity: sha1-mPx0QrDh3NSPSOYGyR1SUyi3lyA=, tarball: https://gitlab.syncad.com/api/v4/projects/198/packages/npm/@hiveio/beekeeper/-/@hiveio/beekeeper-1.27.10-stable.250305202831.tgz}
engines: {node: ^20.11 || >= 21.2}
'@isaacs/cliui@8.0.2':
......@@ -2068,7 +2068,7 @@ snapshots:
'@shikijs/types': 1.24.2
'@shikijs/vscode-textmate': 9.3.1
'@hiveio/beekeeper@1.27.9-stable.250219154236': {}
'@hiveio/beekeeper@1.27.10-stable.250305202831': {}
'@isaacs/cliui@8.0.2':
dependencies:
......
......@@ -99,7 +99,12 @@ export default {
"precision": 6
},
"posting": {
"account_auths": [],
"account_auths": [
[
"guest4test8",
1
]
],
"key_auths": [
[
"STM6a34GANY5LD8deYvvfySSWGd7sPahgVNYoFPapngMUD27pWb45",
......
export default {
id: 1,
jsonrpc: '2.0',
result: {
accounts: [
{
"active": {
"account_auths": [],
"key_auths": [
[
"STM7cUebxApQ9N4xFHtVrKKuLbUHCei5QoEhHX7WYx9tXHVCZGXVP",
1
]
],
"weight_threshold": 1
},
"balance": {
"amount": "2",
"nai": "@@000000021",
"precision": 3
},
"can_vote": true,
"comment_count": 0,
"created": "2023-05-26T03:07:12",
"curation_rewards": 72010,
"delayed_votes": [
{
"time": "2024-10-09T23:28:45",
"val": 3339250806
},
{
"time": "2024-10-14T11:13:27",
"val": 1703102215
},
{
"time": "2024-10-16T09:49:03",
"val": 1702819483
},
{
"time": "2024-10-18T14:10:36",
"val": 1702501238
},
{
"time": "2024-10-20T11:08:09",
"val": 1702227839
}
],
"delegated_vesting_shares": {
"amount": "0",
"nai": "@@000000037",
"precision": 6
},
"downvote_manabar": {
"current_mana": 842487485158,
"last_update_time": 1730811981
},
"governance_vote_expiration_ts": "2025-10-05T02:07:33",
"hbd_balance": {
"amount": "12",
"nai": "@@000000013",
"precision": 3
},
"hbd_last_interest_payment": "1970-01-01T00:00:00",
"hbd_seconds": "0",
"hbd_seconds_last_update": "1970-01-01T00:00:00",
"id": 2458449,
"is_smt": false,
"json_metadata": "[]",
"last_account_recovery": "1970-01-01T00:00:00",
"last_account_update": "2024-03-08T01:31:24",
"last_owner_update": "2023-11-20T11:59:03",
"last_post": "2024-11-05T09:36:03",
"last_post_edit": "2024-11-05T09:36:03",
"last_root_post": "2024-10-29T14:59:36",
"last_vote_time": "2024-11-05T13:06:21",
"lifetime_vote_count": 0,
"memo_key": "STM8m7a4dNtBDAUXZQdjpjYQosEQA4ep1caTRSrwUwH7jhH5TCpJU",
"mined": false,
"name": "guest4test8",
"next_vesting_withdrawal": "1969-12-31T23:59:59",
"open_recurrent_transfers": 0,
"owner": {
"account_auths": [],
"key_auths": [
[
"STM6adcTdVnt4iWbfEfiKZmwt6pNsoQnVKheZchL7vnnpCWYwRWDh",
1
]
],
"weight_threshold": 1
},
"pending_claimed_accounts": 0,
"pending_transfers": 0,
"post_bandwidth": 0,
"post_count": 589,
"post_voting_power": {
"amount": "3369949940632",
"nai": "@@000000037",
"precision": 6
},
"posting": {
"account_auths": [],
"key_auths": [
[
"STM6ooSpKC7jEhujcCakiH881MSgJhddrVb1dNCc1h47wF2nqB9zb",
1
]
],
"weight_threshold": 1
},
"posting_json_metadata": "{\"profile\":{\"name\":\"Tattoo World\",\"about\":\"Tattoo World Community\",\"cover_image\":\"https://files.peakd.com/file/peakd-hive/tattooworld/Portada.jpg\",\"profile_image\":\"https://files.peakd.com/file/peakd-hive/tattooworld/IMG-20230514-WA0266.jpg\",\"website\":\"\",\"location\":\"\",\"pinned\":\"\",\"version\":2}}",
"posting_rewards": 857992,
"previous_owner_update": "2023-11-18T22:53:42",
"proxied_vsf_votes": [
0,
0,
0,
0
],
"proxy": "",
"received_vesting_shares": {
"amount": "2365791627026",
"nai": "@@000000037",
"precision": 6
},
"recovery_account": "leo.voter",
"reset_account": "null",
"reward_hbd_balance": {
"amount": "0",
"nai": "@@000000013",
"precision": 3
},
"reward_hive_balance": {
"amount": "0",
"nai": "@@000000021",
"precision": 3
},
"reward_vesting_balance": {
"amount": "316265506",
"nai": "@@000000037",
"precision": 6
},
"reward_vesting_hive": {
"amount": "186",
"nai": "@@000000021",
"precision": 3
},
"savings_balance": {
"amount": "0",
"nai": "@@000000021",
"precision": 3
},
"savings_hbd_balance": {
"amount": "56582",
"nai": "@@000000013",
"precision": 3
},
"savings_hbd_last_interest_payment": "2024-10-17T22:02:27",
"savings_hbd_seconds": "20014995276",
"savings_hbd_seconds_last_update": "2024-10-22T00:42:27",
"savings_withdraw_requests": 0,
"to_withdraw": 0,
"vesting_shares": {
"amount": "1004158313606",
"nai": "@@000000037",
"precision": 6
},
"vesting_withdraw_rate": {
"amount": "0",
"nai": "@@000000037",
"precision": 6
},
"voting_manabar": {
"current_mana": 3000664392861,
"last_update_time": 1730811981
},
"withdraw_routes": 0,
"withdrawn": 0,
"witnesses_voted_for": 7
}
],
},
};
......@@ -8,6 +8,7 @@ import directSigners_5 from "./data/directSigners_5";
import directSigners_6 from "./data/directSigners_6";
import alice from "./data/alice";
import hivebuzz from "./data/hivebuzz";
import guest4test8 from "./data/guest4test8";
export default {
"database_api.find_accounts": (params: Record<string, any>) => {
......@@ -42,6 +43,9 @@ export default {
if (accounts.length === 1 && accounts[0] === 'hivebuzz')
return hivebuzz;
if (accounts.length === 1 && accounts[0] === 'guest4test8')
return guest4test8;
return;
}
} satisfies IJsonRpcMockData;
......@@ -107,10 +107,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1,
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "205f0e25631bdbcd37669b2f6c36594d0153e468be8b2b6a57f8eae49538132efd0dde1ad6a707788d6a2024efd03a55dd0bb478a40eedce48f6e5db19d365bce5",
"signatureKey": "STM8AZuk2ja5vSFySFL2zpB9bNew8wJAg8r4QFtbnoamEX8Jvvq43",
},
}],
},
{
"finalAuthorityPath": {
......@@ -138,10 +138,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1,
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "20223edff229382e67031d993c13d26062ab4d33c45ede7aced7f1e432d6b6d57a4fd68eae708f562a9644ee08ea447fa354febe34aa8ba14a434c66adc753774f",
"signatureKey": "STM8jviUDRAefxmTQ9m8wNdiQV5dmCPSMDjSnztPYZpHf1yfaD6Rd",
},
}],
},
{
"finalAuthorityPath": {
......@@ -169,10 +169,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1,
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "20286bd3b0ad2ecb01488ce866361b4fcd53b1f3dac41962496986fdf89c89c20a0e86f8dd2669ed14b6dafc3e0bb0d24ec54a794ee6c0b563275a22a122992ac1",
"signatureKey": "STM64Bb5TXsiEbjjLsgVrvVttEDsLNSot9p8zJd41D5zEr5opxcHK",
},
}],
},
{
"finalAuthorityPath": {
......@@ -200,10 +200,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1,
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "1f4141e7645dd2bdcdb2001baea165e668a6f9c2a366f6fd2f3e9d878f071f5eb052509eb666b80c1e0daaa7fdec36e3de827087dcd3015c8672b536ddddbc5726",
"signatureKey": "STM7S3wsVtQotgKLN8wFLPNBALe6YHt8MPLEHuTH5CxfxdhpGPBUP",
},
}],
},
{
"finalAuthorityPath": {
......@@ -231,10 +231,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "2043b5ea9cbf76f1cd0fbb5f589350d9b8273d241c8bb704189bc9fd4444493c384594536e0387ff121bcdbfa4fa401917e30609ac86ea82f13132d26280e74f9a",
"signatureKey": "STM5dhkPS223F9d3TCXKttuWpdWgqS2Fx8KNRQve6BMGmAvJ5GnJR"
}
}]
}
]);
});
......@@ -267,7 +267,7 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
const authTrace = await tx.generateAuthorityVerificationTrace();
authTrace.collectedData[0].matchingSignature!.signature = 'fakeSignature'; // The signature changes every time so we need to fake it.
authTrace.collectedData[0].matchingSignatures[0].signature = 'fakeSignature'; // The signature changes every time so we need to fake it.
const authTraceStr = JSON.stringify(authTrace);
console.log(`Authority trace: ${authTraceStr }`);
......@@ -302,10 +302,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "fakeSignature",
"signatureKey": "STM6LLegbAgLAy28EHrffBVuANFWcFgmqRMW13wBmTExqFE9SCkg4"
}
}]
}
]);
});
......@@ -360,10 +360,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "203eed491a1e032bc889b030861a80bf3f0bc8ba7fa30843041825c4f542411fb3678fd527c598dcc6646a5dabf2110691a4d6355c72d7638ffdaa11ac10451d07",
"signatureKey": "STM7jDAdjyLYgqhyCwSafVzNGN4PLBGWrYB9uJun4AitZA8TERgif"
}
}]
}
]);
});
......@@ -453,10 +453,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "20543c6e9e5ea2acfb94e9c5cd6672f302d067b62a4c71832dcaec7caf5e83a83b45ae76c55e3f51f8eb254b460a0585e7f911a93d6e5a58522429b7a4678dc22e",
"signatureKey": "STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF"
}
}]
}
]);
});
......@@ -533,10 +533,10 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
],
"weight": 1
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "20282d87e22cad745d263ee43fe8552044ecb68ebd274a03421d6e59aaaa891d5a594808c58605828c240b9e498f53d32a8f4f7baec5bfcbc7d391af4e4283366e",
"signatureKey": "STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF"
}
}]
}
]);
});
......@@ -590,7 +590,8 @@ test.describe('Wax chain tests to cover Online Transaction flow', () => {
"isOpenAuthority": true
},
"visitedEntries":[]
}
},
"matchingSignatures": []
}
]);
});
......
......@@ -95,10 +95,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "1f411808fe07ba78c8e0d1edc7e4bdf14b8af1b85a26437fd7e082054fc0fa5b503627072e4cc482d1a4e60ea5f318a85539282c5beb9747e83a429bcd369d1ece",
"signatureKey": "STM7UEziXTT9CMCTLvSpWsS974XiYCGSb9jP3ycriAXFFoQVWxzZK"
}
}]
}
]);
});
......@@ -260,10 +260,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "20282d87e22cad745d263ee43fe8552044ecb68ebd274a03421d6e59aaaa891d5a594808c58605828c240b9e498f53d32a8f4f7baec5bfcbc7d391af4e4283366e",
"signatureKey": "STM8WWUYHMdHLgEHidYCztswzfZCViA16EqGkAxt7RG4dWwDpFtCF"
}
}]
}
]);
});
......@@ -369,7 +369,8 @@ test.describe('Wax base mock tests', () => {
"hasMatchingPublicKey":false
},
"visitedEntries":[]
}
},
"matchingSignatures": []
},
{
"finalAuthorityPath":{
......@@ -397,10 +398,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"205e09b4e5af6338f2a2d90a5d7a0a7c64203668f53beb0dd24b401cec25a347190988aaa102af008674803d6665647258f99076b3a1dc2da7c2629b1f61332d60",
"signatureKey":"STM8jviUDRAefxmTQ9m8wNdiQV5dmCPSMDjSnztPYZpHf1yfaD6Rd"
}
}]
},
{
"finalAuthorityPath":{
......@@ -428,10 +429,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"2043c1aadca24f71aab3efb48aa809d06f644ef17fe7016febea9d75fb2207710a14ed0a7ae72180acab16676bdce6d05638e6bd9b719a4b41eaf201095776aab9",
"signatureKey":"STM8UxNA8pQpL7wtvzZUrfFFz1qGxgGH6a1VnJqDTGbivsU3Mi4Mz"
}
}]
},
{
"finalAuthorityPath":{
......@@ -459,10 +460,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"1f4149e010568da05380ae5beb143bb94db658567c20b73228ea84b269da7bc82208b9493535515ad4aef8c347bd8c9681b7827af9720130c20999774518cb620b",
"signatureKey":"STM64Bb5TXsiEbjjLsgVrvVttEDsLNSot9p8zJd41D5zEr5opxcHK"
}
}]
},
{
"finalAuthorityPath":{
......@@ -491,10 +492,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"1f475ba65d89c97fc82c7858ae863154d6770b0dea7aafc94e111a9c8a3bcb7cba17d29a86e93c5eae3a5f8b51f963a8532c33313bf7e3d5a43a31d8ddfaef8251",
"signatureKey":"STM7S3wsVtQotgKLN8wFLPNBALe6YHt8MPLEHuTH5CxfxdhpGPBUP"
}
}]
},
{
"finalAuthorityPath":{
......@@ -522,10 +523,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"1f73e14ee975d584f121c7ad3de059d4f361cdbb417a0020b911efe77632bd86044c33d276ea72fb45d1138d061c90226f6127dc163e1ac92baf3340eb1848b09f",
"signatureKey":"STM5dhkPS223F9d3TCXKttuWpdWgqS2Fx8KNRQve6BMGmAvJ5GnJR"
}
}]
}
]);
});
......@@ -620,10 +621,14 @@ test.describe('Wax base mock tests', () => {
],
"weight": 2
},
"matchingSignature": {
"matchingSignatures": [{
"signature": "1f32e76fbebe2a92a2b83953e62460ef150bac1ab0989bc5338bbc3a3978c077573403787d509b669f548ccdc06ec6c1995dadd51b5221172635df0f1a443a4d8f",
"signatureKey": "STM5RqVBAVNp5ufMCetQtvLGLJo7unX9nyCBMMrTXRWQ9i1Zzzizh"
},
{
"signature": "209b7e96212bf1d776187d9321e083eddfed55f9b4b2bf58034302255eb7b8402e436519b4d391bc54462920a9fb1e36b5f60c951e51895f0e19ac3b22f1a97af1",
"signatureKey": "STM6a34GANY5LD8deYvvfySSWGd7sPahgVNYoFPapngMUD27pWb45"
}
}]
}
]);
});
......@@ -727,10 +732,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"205f0e25631bdbcd37669b2f6c36594d0153e468be8b2b6a57f8eae49538132efd0dde1ad6a707788d6a2024efd03a55dd0bb478a40eedce48f6e5db19d365bce5",
"signatureKey":"STM8AZuk2ja5vSFySFL2zpB9bNew8wJAg8r4QFtbnoamEX8Jvvq43"
}
}]
},
{
"finalAuthorityPath":{
......@@ -758,10 +763,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"20223edff229382e67031d993c13d26062ab4d33c45ede7aced7f1e432d6b6d57a4fd68eae708f562a9644ee08ea447fa354febe34aa8ba14a434c66adc753774f",
"signatureKey":"STM8jviUDRAefxmTQ9m8wNdiQV5dmCPSMDjSnztPYZpHf1yfaD6Rd"
}
}]
},
{
"finalAuthorityPath":{
......@@ -789,10 +794,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"20286bd3b0ad2ecb01488ce866361b4fcd53b1f3dac41962496986fdf89c89c20a0e86f8dd2669ed14b6dafc3e0bb0d24ec54a794ee6c0b563275a22a122992ac1",
"signatureKey":"STM64Bb5TXsiEbjjLsgVrvVttEDsLNSot9p8zJd41D5zEr5opxcHK"
}
}]
},
{
"finalAuthorityPath":{
......@@ -821,10 +826,10 @@ test.describe('Wax base mock tests', () => {
}
]
},
"matchingSignature":{
"matchingSignatures":[{
"signature":"1f4141e7645dd2bdcdb2001baea165e668a6f9c2a366f6fd2f3e9d878f071f5eb052509eb666b80c1e0daaa7fdec36e3de827087dcd3015c8672b536ddddbc5726",
"signatureKey":"STM7S3wsVtQotgKLN8wFLPNBALe6YHt8MPLEHuTH5CxfxdhpGPBUP"
}
}]
},
{
"finalAuthorityPath":{
......@@ -843,7 +848,110 @@ test.describe('Wax base mock tests', () => {
"hasMatchingPublicKey":false
},
"visitedEntries":[]
}
},
"matchingSignatures": []
}
]);
});
test('Should be able to get authority trace with mock data for transaction with one required authority with threshold 2 (one signature direct and the other one redirected)', async ({ waxTest }) => {
const retVal = await waxTest(async({ chain }) => {
const sourceTx = chain.createTransactionFromJson({
"ref_block_num": 55285,
"ref_block_prefix": 3183350724,
"expiration": "2025-03-04T09:40:37",
"operations": [
{
"type": "vote_operation",
"value": {
"voter": "alice",
"author": "test",
"permlink": "test",
"weight": 10000
}
}
],
"signatures": [
"20a5932916064c776785df77821b0aaaa442af49faab4304083764de0a25de4ab660aec343efdb443ffa479446dfd1f433f3b968ad8f821c9497e4671f762e0d3a",
"2068fd39a6a9751877b707e56adf1b8a814b02a7168e0be906e295daf4e35fbe072bf5dba4bfe5567239ed88aab84449bec09237b504ee5a0afaa1fb1e51770947"
]
});
const tx = await chain.createTransaction();
const trace = await tx.generateAuthorityVerificationTrace(false, sourceTx);
console.log(JSON.stringify(trace.collectedData));
return trace.collectedData;
});
expect(retVal).toStrictEqual([
{
"finalAuthorityPath": {
"processedEntry": "alice",
"processedRole": "posting",
"threshold": 2,
"weight": 2,
"recursionDepth": 0,
"processingStatus": {
"entryAccepted": true,
"isOpenAuthority": false
},
"visitedEntries": [
{
"processedEntry": "STM5RqVBAVNp5ufMCetQtvLGLJo7unX9nyCBMMrTXRWQ9i1Zzzizh",
"processedRole": "posting",
"threshold": 2,
"weight": 1,
"recursionDepth": 0,
"processingStatus": {
"entryAccepted": false,
"accountAuthorityProcessingDepthExceeded": false,
"accountAuthorityCountExceeded": false,
"accountAuthorityPointsMissingAccount": false,
"hasAccountAuthorityCycle": false,
"hasInsufficientWeight": true,
"hasMatchingPublicKey": true
},
"visitedEntries": []
},
{
"processedEntry": "guest4test8",
"processedRole": "posting",
"threshold": 1,
"weight": 1,
"recursionDepth": 1,
"processingStatus": {
"entryAccepted": true,
"isOpenAuthority": false
},
"visitedEntries": [
{
"processedEntry": "STM6ooSpKC7jEhujcCakiH881MSgJhddrVb1dNCc1h47wF2nqB9zb",
"processedRole": "posting",
"threshold": 1,
"weight": 1,
"recursionDepth": 1,
"processingStatus": {
"entryAccepted": true,
"isOpenAuthority": false
},
"visitedEntries": []
}
]
}
]
},
"matchingSignatures": [
{
"signature": "2068fd39a6a9751877b707e56adf1b8a814b02a7168e0be906e295daf4e35fbe072bf5dba4bfe5567239ed88aab84449bec09237b504ee5a0afaa1fb1e51770947",
"signatureKey": "STM5RqVBAVNp5ufMCetQtvLGLJo7unX9nyCBMMrTXRWQ9i1Zzzizh"
},
{
"signature": "20a5932916064c776785df77821b0aaaa442af49faab4304083764de0a25de4ab660aec343efdb443ffa479446dfd1f433f3b968ad8f821c9497e4671f762e0d3a",
"signatureKey": "STM6ooSpKC7jEhujcCakiH881MSgJhddrVb1dNCc1h47wF2nqB9zb"
}]
}
]);
});
......
......@@ -98,33 +98,39 @@ const buildAuthorityPathTraceData = (signatureKeyInfo: Map<TPublicKey, TSignatur
return {
finalAuthorityPath,
matchingSignature: {
matchingSignatures: [{
signature,
signatureKey
}
}]
};
}
else {
return {
finalAuthorityPath
};
finalAuthorityPath,
matchingSignatures: []
}
}
}
let matchingSignature: IAuthorityTraceSignatureInfo|undefined;
const uniqueSignatures: Set<TSignature> = new Set();
let matchingSignatures: IAuthorityTraceSignatureInfo[] = [];
for (let i = 0; i < size; i++) {
const visitedEntry = entry.visited_entries.get(i)!;
const data = buildAuthorityPathTraceData(signatureKeyInfo, visitedEntry);
visitedEntries.push(data.finalAuthorityPath);
if(data.matchingSignature !== undefined)
matchingSignature = data.matchingSignature;
for(const sigInfo of data.matchingSignatures) {
if(!uniqueSignatures.has(sigInfo.signature)) {
matchingSignatures.push(sigInfo);
uniqueSignatures.add(sigInfo.signature);
}
}
}
return {
finalAuthorityPath,
matchingSignature
matchingSignatures
};
}
......
......@@ -35,6 +35,11 @@ export type TAuthorityEntryVerificationFailure = {
* - false when authority does not contain any matching key
*/
hasMatchingPublicKey: boolean;
/**
* Will be set to non-null value when given (decoded from signature) public key matched to some account, but it is not associated in any way to required authority account.
*/
unrelatedAccountMatchedToPublicKey?: TAccountName;
};
/**
......@@ -116,9 +121,10 @@ export interface IAuthorityTraceSignatureInfo {
*/
export interface IAuthorityPathTraceData {
/**
* Optionally filled when procesed authority path matched to the signature and its decoded public key.
* Optionally filled when procesed authority path matched to the signatures and its decoded public key.
* Can be empty when no matching signature has been found.
*/
matchingSignature?: IAuthorityTraceSignatureInfo;
matchingSignatures: IAuthorityTraceSignatureInfo[];
/**
* Stores data specific to the authority path chosen:
......