Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Fix three terribly named variables #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 src/batch-submitter/tx-batch-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export class TransactionBatchSubmitter extends BatchSubmitter {

return {
// TODO: Remove BLOCK_OFFSET by adding a tx to Geth's genesis
shouldStartAtBatch: shouldStartAtIndex - BLOCK_OFFSET,
shouldStartAtElement: shouldStartAtIndex - BLOCK_OFFSET,
totalElementsToAppend,
contexts,
transactions,
Expand Down
6 changes: 3 additions & 3 deletions src/transaciton-chain-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface BatchContext {
}

export interface AppendSequencerBatchParams {
shouldStartAtBatch: number // 5 bytes -- starts at batch
shouldStartAtElement: number // 5 bytes -- starts at batch
totalElementsToAppend: number // 3 bytes -- total_elements_to_append
contexts: BatchContext[] // total_elements[fixed_size[]]
transactions: string[] // total_size_bytes[],total_size_bytes[]
Expand Down Expand Up @@ -53,7 +53,7 @@ const appendSequencerBatch = async (
export const encodeAppendSequencerBatch = (
b: AppendSequencerBatchParams
): string => {
const encodedShouldStartAtBatch = encodeHex(b.shouldStartAtBatch, 10)
const encodedShouldStartAtElement = encodeHex(b.shouldStartAtElement, 10)
const encodedTotalElementsToAppend = encodeHex(b.totalElementsToAppend, 6)

const encodedContextsHeader = encodeHex(b.contexts.length, 6)
Expand All @@ -71,7 +71,7 @@ export const encodeAppendSequencerBatch = (
return acc + encodedTxDataHeader + remove0x(cur)
}, '')
return (
encodedShouldStartAtBatch +
encodedShouldStartAtElement +
encodedTotalElementsToAppend +
encodedContexts +
encodedTransactionData
Expand Down