Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core-blockchain/src/state-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let _cachedTransactionIds: immutable.OrderedSet<string> = immutable.OrderedSet()

// Map Block instances to block data.
const _mapToBlockData = (blocks: immutable.Seq<number, models.Block>): immutable.Seq<number, models.IBlockData> =>
blocks.map(block => ({ ...block.data, transactions: block.transactions }));
blocks.map(block => ({ ...block.data, transactions: block.transactions.map(tx => tx.data) }));

/**
* Represents an in-memory storage for state machine data.
Expand Down
5 changes: 3 additions & 2 deletions packages/core-transaction-pool/__tests__/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ describe("Connection", () => {
it("should not add not-appliable transactions", () => {
// This should be skipped due to insufficient funds
const highFeeTransaction = new Transaction(mockData.dummy3);
highFeeTransaction.fee = bignumify(1e9 * SATOSHI);
highFeeTransaction.data.fee = bignumify(1e9 * SATOSHI);
// changing public key as fixture transactions have the same one
highFeeTransaction.senderPublicKey = "000000000000000000000000000000000000000420000000000000000000000000";
highFeeTransaction.data.senderPublicKey =
"000000000000000000000000000000000000000420000000000000000000000000";

const transactions = [
mockData.dummy1,
Expand Down
2 changes: 1 addition & 1 deletion packages/core-transaction-pool/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class TransactionPool implements transactionPool.ITransactionPool {
const senderWallet = this.walletManager.findByPublicKey(transaction.senderPublicKey);

const errors = [];
if (this.walletManager.canApply(transaction, errors)) {
if (this.walletManager.canApply(transaction.data, errors)) {
senderWallet.applyTransactionToSender(transaction);
} else {
// Remove tx again from the pool
Expand Down