Skip to content

Commit

Permalink
[sdk]: bump aggregate transaction version to 2
Browse files Browse the repository at this point in the history
 problem: aggregate transaction version needs to be bumped after client fix
solution: bump aggregate transaction version to 2
  • Loading branch information
Jaguar0625 committed Oct 18, 2022
1 parent 47085b2 commit 86904d7
Show file tree
Hide file tree
Showing 13 changed files with 1,237 additions and 165 deletions.
29 changes: 27 additions & 2 deletions catbuffer/schemas/symbol/aggregate/aggregate.cats
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inline struct AggregateTransactionBody
# Fills up remaining body space after transactions.
cosignatures = array(Cosignature, __FILL__)

# Send transactions in batches to different accounts (V1, latest).
# Send transactions in batches to different accounts (V1, deprecated).
#
# Use this transaction when all required signatures are available when the transaction is created.
struct AggregateCompleteTransactionV1
Expand All @@ -39,7 +39,17 @@ struct AggregateCompleteTransactionV1
inline Transaction
inline AggregateTransactionBody

# Propose an arrangement of transactions between different accounts (V1, latest).
# Send transactions in batches to different accounts (V2, latest).
#
# Use this transaction when all required signatures are available when the transaction is created.
struct AggregateCompleteTransactionV2
TRANSACTION_VERSION = make_const(uint8, 2)
TRANSACTION_TYPE = make_const(TransactionType, AGGREGATE_COMPLETE)

inline Transaction
inline AggregateTransactionBody

# Propose an arrangement of transactions between different accounts (V1, deprecated).
#
# Use this transaction when not all required signatures are available when the transaction is created.
#
Expand All @@ -53,3 +63,18 @@ struct AggregateBondedTransactionV1

inline Transaction
inline AggregateTransactionBody

# Propose an arrangement of transactions between different accounts (V2, latest).
#
# Use this transaction when not all required signatures are available when the transaction is created.
#
# Missing signatures must be provided using a Cosignature or DetachedCosignature.
#
# To prevent spam attacks, before trying to announce this transaction a HashLockTransaction must be
# successfully announced and confirmed.
struct AggregateBondedTransactionV2
TRANSACTION_VERSION = make_const(uint8, 2)
TRANSACTION_TYPE = make_const(TransactionType, AGGREGATE_BONDED)

inline Transaction
inline AggregateTransactionBody
2 changes: 1 addition & 1 deletion sdk/javascript/examples/transaction_aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { fileURLToPath } from 'url';
const merkleHash = facade.constructor.hashEmbeddedTransactions(embeddedTransactions);

const aggregateTransaction = facade.transactionFactory.create({
type: 'aggregate_complete_transaction_v1',
type: 'aggregate_complete_transaction_v2',
signerPublicKey: keyPair.publicKey,
fee: 0n,
deadline: 1n,
Expand Down
2 changes: 1 addition & 1 deletion sdk/javascript/examples/transaction_multisig.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import symbolSdk from '../src/index.js';
];

return this.facade.transactionFactory.create({
type: 'aggregate_complete_transaction_v1',
type: 'aggregate_complete_transaction_v2',
signerPublicKey: this.multisigkeyPair.publicKey,
fee: 625n,
deadline: 12345n,
Expand Down
Loading

0 comments on commit 86904d7

Please sign in to comment.