Skip to content

Commit 0749efe

Browse files
committed
Applied catbuffer on aggregate transaction
1 parent 99fd613 commit 0749efe

12 files changed

+15
-32
lines changed

src/infrastructure/catbuffer/AggregateTransactionBuilder.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@
1919
*** along with Catapult. If not, see <http://www.gnu.org/licenses/>.
2020
**/
2121

22-
import { AddressAliasTransactionBodyBuilder } from './AddressAliasTransactionBodyBuilder';
23-
import { AddressDto } from './AddressDto';
24-
import { AliasActionDto } from './AliasActionDto';
2522
import { AmountDto } from './AmountDto';
2623
import { EntityTypeDto } from './EntityTypeDto';
2724
import { GeneratorUtils } from './GeneratorUtils';
2825
import { KeyDto } from './KeyDto';
29-
import { NamespaceIdDto } from './NamespaceIdDto';
3026
import { SignatureDto } from './SignatureDto';
3127
import { TimestampDto } from './TimestampDto';
3228
import { TransactionBuilder } from './TransactionBuilder';
@@ -129,7 +125,7 @@ export class AggregateTransactionBuilder extends TransactionBuilder {
129125
newArray = GeneratorUtils.concatTypedArrays(newArray, payloadSizeBytes);
130126
const transactionBytes = this.transactions;
131127
newArray = GeneratorUtils.concatTypedArrays(newArray, transactionBytes);
132-
const cosignaturesBytes = this.transactions;
128+
const cosignaturesBytes = this.cosignatures;
133129
newArray = GeneratorUtils.concatTypedArrays(newArray, cosignaturesBytes);
134130
return newArray;
135131
}

src/model/transaction/AccountAddressRestrictionTransaction.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { RawAddress } from '../../core/format';
17+
import { Convert, RawAddress } from '../../core/format';
1818
import { Builder } from '../../infrastructure/builders/AccountRestrictionsAddressTransaction';
1919
import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction';
2020
import { AccountAddressRestrictionModificationBuilder } from '../../infrastructure/catbuffer/AccountAddressRestrictionModificationBuilder';
@@ -151,10 +151,8 @@ export class AccountAddressRestrictionTransaction extends Transaction {
151151
* @returns {Uint8Array}
152152
*/
153153
protected generateEmbeddedBytes(): Uint8Array {
154-
const signerBuffer = new Uint8Array(32);
155-
156154
const transactionBuilder = new EmbeddedAccountAddressRestrictionTransactionBuilder(
157-
new KeyDto(signerBuffer),
155+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
158156
this.versionToDTO(),
159157
TransactionType.ACCOUNT_RESTRICTION_ADDRESS.valueOf(),
160158
this.restrictionType.valueOf(),

src/model/transaction/AccountMosaicRestrictionTransaction.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { Convert } from '../../core/format';
1718
import { Builder } from '../../infrastructure/builders/AccountRestrictionsMosaicTransaction';
1819
import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction';
1920
import { AccountMosaicRestrictionModificationBuilder } from '../../infrastructure/catbuffer/AccountMosaicRestrictionModificationBuilder';
2021
import { AccountMosaicRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder';
2122
import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
2223
import { EmbeddedAccountMosaicRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder';
23-
import { EntityTypeDto } from '../../infrastructure/catbuffer/EntityTypeDto';
2424
import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
2525
import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
2626
import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
@@ -150,10 +150,8 @@ export class AccountMosaicRestrictionTransaction extends Transaction {
150150
* @returns {Uint8Array}
151151
*/
152152
protected generateEmbeddedBytes(): Uint8Array {
153-
const signerBuffer = new Uint8Array(32);
154-
155153
const transactionBuilder = new EmbeddedAccountMosaicRestrictionTransactionBuilder(
156-
new KeyDto(signerBuffer),
154+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
157155
this.versionToDTO(),
158156
TransactionType.ACCOUNT_RESTRICTION_MOSAIC.valueOf(),
159157
this.restrictionType.valueOf(),

src/model/transaction/AccountOperationRestrictionTransaction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { Convert } from '../../core/format';
1718
import { Builder } from '../../infrastructure/builders/AccountRestrictionsEntityTypeTransaction';
1819
import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction';
1920
import { AccountOperationRestrictionModificationBuilder } from '../../infrastructure/catbuffer/AccountOperationRestrictionModificationBuilder';
@@ -148,10 +149,8 @@ export class AccountOperationRestrictionTransaction extends Transaction {
148149
* @returns {Uint8Array}
149150
*/
150151
protected generateEmbeddedBytes(): Uint8Array {
151-
const signerBuffer = new Uint8Array(32);
152-
153152
const transactionBuilder = new EmbeddedAccountOperationRestrictionTransactionBuilder(
154-
new KeyDto(signerBuffer),
153+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
155154
this.versionToDTO(),
156155
TransactionType.ACCOUNT_RESTRICTION_OPERATION.valueOf(),
157156
this.restrictionType.valueOf(),

src/model/transaction/AddressAliasTransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ export class AddressAliasTransaction extends Transaction {
189189
* @returns {Uint8Array}
190190
*/
191191
protected generateEmbeddedBytes(): Uint8Array {
192-
const signerBuffer = new Uint8Array(32);
193-
194192
const transactionBuilder = new EmbeddedAddressAliasTransactionBuilder(
195-
new KeyDto(signerBuffer),
193+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
196194
this.versionToDTO(),
197195
TransactionType.ADDRESS_ALIAS.valueOf(),
198196
this.actionType.valueOf(),

src/model/transaction/AggregateTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,6 @@ export class AggregateTransaction extends Transaction {
340340
* @returns {Uint8Array}
341341
*/
342342
protected generateEmbeddedBytes(): Uint8Array {
343-
throw new Error('Not implemented');
343+
throw new Error('Method not implemented');
344344
}
345345
}

src/model/transaction/ModifyMultisigAccountTransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,8 @@ export class ModifyMultisigAccountTransaction extends Transaction {
213213
* @returns {Uint8Array}
214214
*/
215215
protected generateEmbeddedBytes(): Uint8Array {
216-
const signerBuffer = new Uint8Array(32);
217-
218216
const transactionBuilder = new EmbeddedMultisigAccountModificationTransactionBuilder(
219-
new KeyDto(signerBuffer),
217+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
220218
this.versionToDTO(),
221219
TransactionType.MODIFY_MULTISIG_ACCOUNT.valueOf(),
222220
this.minRemovalDelta,

src/model/transaction/MosaicAliasTransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ export class MosaicAliasTransaction extends Transaction {
185185
* @returns {Uint8Array}
186186
*/
187187
protected generateEmbeddedBytes(): Uint8Array {
188-
const signerBuffer = new Uint8Array(32);
189-
190188
const transactionBuilder = new EmbeddedMosaicAliasTransactionBuilder(
191-
new KeyDto(signerBuffer),
189+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
192190
this.versionToDTO(),
193191
TransactionType.MOSAIC_ALIAS.valueOf(),
194192
this.actionType.valueOf(),

src/model/transaction/MosaicDefinitionTransaction.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,8 @@ export class MosaicDefinitionTransaction extends Transaction {
239239
* @returns {Uint8Array}
240240
*/
241241
protected generateEmbeddedBytes(): Uint8Array {
242-
const signerBuffer = new Uint8Array(32);
243-
244242
const transactionBuilder = new EmbeddedMosaicDefinitionTransactionBuilder(
245-
new KeyDto(signerBuffer),
243+
new KeyDto(Convert.hexToUint8(this.signer!.publicKey)),
246244
this.versionToDTO(),
247245
TransactionType.MOSAIC_DEFINITION.valueOf(),
248246
new MosaicNonceDto(this.getMosaicNonceIntValue()),

src/model/transaction/MosaicSupplyChangeTransaction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { Transaction } from './Transaction';
3434
import { TransactionInfo } from './TransactionInfo';
3535
import { TransactionType } from './TransactionType';
3636
import { TransactionVersion } from './TransactionVersion';
37+
import { Convert } from '../../core/format';
3738

3839
/**
3940
* In case a mosaic has the flag 'supplyMutable' set to true, the creator of the mosaic can change the supply,

0 commit comments

Comments
 (0)