Skip to content

Commit db033cf

Browse files
authored
- padded account state voting key (#743)
- change log updates
1 parent 7b59eb2 commit db033cf

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed

CHANGELOG.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [0.22.1] - 10-Dec-2020
7+
## [0.22.2] - 12-Dec-2020
88

99
**Milestone**: Catapult-server finality(0.10.0.4)
1010
Package | Version | Link
1111
---|---|---
12-
SDK Core| v0.22.1 | [symbol-sdk](https://www.npmjs.com/package/symbol-sdk)
13-
Catbuffer | v0.0.24 | [catbuffer-typescript](https://www.npmjs.com/package/catbuffer-typescript)
12+
SDK Core| v0.22.2 | [symbol-sdk](https://www.npmjs.com/package/symbol-sdk)
13+
Catbuffer | v0.0.25 | [catbuffer-typescript](https://www.npmjs.com/package/catbuffer-typescript)
1414
Client Library | v0.10.5-1 | [symbol-openapi-typescript-fetch-client](https://www.npmjs.com/package/symbol-openapi-typescript-fetch-client)
1515

16-
- Fixed finalization proof schema version compatibility issue.
17-
18-
## [0.22.0] - 8-Dec-2020
19-
20-
**Milestone**: Catapult-server finality(0.10.0.4)
21-
Package | Version | Link
22-
---|---|---
23-
SDK Core| v0.22.0 | [symbol-sdk](https://www.npmjs.com/package/symbol-sdk)
24-
Catbuffer | v0.0.24 | [catbuffer-typescript](https://www.npmjs.com/package/catbuffer-typescript)
25-
Client Library | v0.10.4 | [symbol-openapi-typescript-fetch-client](https://www.npmjs.com/package/symbol-openapi-typescript-fetch-client)
26-
2716
- **[BREAKING CHANGE]** `Deadline.create` requires the configurable `epochAdjustment` from the network properties. The value can be retrieved using ``RepositoryFactory.getEpochAdjustment()`` or calling catapult-rest's `network/properties` endpoint.
2817
- **[BREAKING CHANGE]** `NetworkCurrency` subclasses replaced with `Currency` objects. You can retrieve the network currencies with ``RepositoryFactory.getCurrencies()``.
2918
- **[BREAKING CHANGE]** `SecretLockRepository.getSecretLock` has been updated. It now takes the composite hash as parameter.
@@ -41,6 +30,7 @@ Client Library | v0.10.4 | [symbol-openapi-typescript-fetch-client](https://www
4130
- `Listener` now accepts address aliases as `UnresolvedAddress` objects.
4231
- Added V1 and V2 Voting Key transaction support.
4332
- Updated `FinalizationProof` object with the new ``SignatureSchema`` for catapult-server tree testnet/v3.
33+
- Fixed finalization proof schema version compatibility issue.
4434

4535
## [0.21.0] - 25-Sep-2020
4636

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"dependencies": {
100100
"@js-joda/core": "^3.2.0",
101101
"bluebird": "^3.7.2",
102-
"catbuffer-typescript": "0.0.24",
102+
"catbuffer-typescript": "0.0.25",
103103
"crypto-js": "^4.0.0",
104104
"diff": "^4.0.2",
105105
"futoin-hkdf": "^1.3.2",

src/model/account/AccountInfo.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
PinnedVotingKeyBuilder,
3333
VotingKeyDto,
3434
} from 'catbuffer-typescript';
35+
import { VotingKeyPaddingDto } from 'catbuffer-typescript/dist/VotingKeyPaddingDto';
3536
import { Convert } from '../../core/format';
3637
import { Mosaic, MosaicId } from '../mosaic';
3738
import { UInt64 } from '../UInt64';
@@ -179,10 +180,10 @@ export class AccountInfo {
179180
}
180181

181182
private static toPinnedVotingKeyBuilder(key: AccountLinkVotingKey): PinnedVotingKeyBuilder {
182-
const votingKeyDto = new VotingKeyDto(Convert.hexToUint8(key.publicKey));
183+
const votingKeyDto = new VotingKeyDto(Convert.hexToUint8(key.publicKey).slice(0, 32));
183184
const startEpoch: FinalizationEpochDto = new FinalizationEpochDto(key.startEpoch);
184185
const endEpoch: FinalizationEpochDto = new FinalizationEpochDto(key.endEpoch);
185-
return new PinnedVotingKeyBuilder(votingKeyDto, startEpoch, endEpoch);
186+
return new PinnedVotingKeyBuilder(votingKeyDto, new VotingKeyPaddingDto(new Uint8Array(16)), startEpoch, endEpoch);
186187
}
187188

188189
private static toMosaicBuilder(m: Mosaic): MosaicBuilder {

src/model/transaction/VotingKeyLinkV1Transaction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export class VotingKeyLinkV1Transaction extends Transaction {
102102
transactionInfo?: TransactionInfo,
103103
) {
104104
super(TransactionType.VOTING_KEY_LINK, networkType, version, deadline, maxFee, signature, signer, transactionInfo);
105-
Convert.validateHexString(linkedPublicKey, 96, 'Invalid linkedPublicKey');
106105
}
107106

108107
/**

test/model/account/AccountInfo.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@ describe('AccountInfo', () => {
115115

116116
const serialized = accountInfo.serialize();
117117
expect(Convert.uint8ToHex(serialized)).eq(
118-
'01007826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B501000000000000002E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F0D00000000000000000107012E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F3E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F0100000003000000B2C62D18000000003E19000000000000E8030000000000006400000000000000010000000A00000000000000D007000000000000C800000000000000020000001400000000000000B80B0000000000002C01000000000000030000001E00000000000000A00F00000000000090010000000000000400000028000000000000008813000000000000F401000000000000050000003200000000000000010029CF5FD941AD25D5BA9F1C6DB3700100',
118+
'01007826D27E1D0A26CA4E316F901E23E55C8711DB20DF5C49B501000000000000002E834140FD66CF87B254A693A' +
119+
'2C7862C819217B676D3943267156625E816EC6F0D00000000000000000107012E834140FD66CF87B254A693A2C786' +
120+
'2C819217B676D3943267156625E816EC6F2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E81' +
121+
'6EC6F2E834140FD66CF87B254A693A2C7862C819217B676D3943267156625E816EC6F3E834140FD66CF87B254A693' +
122+
'A2C7862C819217B676D3943267156625E816EC6F000000000000000000000000000000000100000003000000B2C62' +
123+
'D18000000003E19000000000000E8030000000000006400000000000000010000000A00000000000000D007000000' +
124+
'000000C800000000000000020000001400000000000000B80B0000000000002C01000000000000030000001E00000' +
125+
'000000000A00F00000000000090010000000000000400000028000000000000008813000000000000F40100000000' +
126+
'0000050000003200000000000000010029CF5FD941AD25D5BA9F1C6DB3700100',
119127
);
120128
deepEqual(AccountStateBuilder.loadFromBinary(serialized).serialize(), serialized);
121129
});

0 commit comments

Comments
 (0)