Skip to content

Commit

Permalink
clean up code docs
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Aug 13, 2024
1 parent 07342f8 commit be12a25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/block/src/consensus/clique.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ export function cliqueVerifySignature(header: BlockHeader, signerList: Address[]
}

/**
* Retrieves the extraData from a sealed block header
* Generates the extraData from a sealed block header
* @param header block header from which to retrieve extraData
* @param cliqueSigner clique signer key used for creating sealed block
* @returns extradata from the block
* @returns clique seal (i.e. extradata) for the block
*/
export function retrieveCliqueBlockExtraData(
export function generateCliqueBlockExtraData(
header: BlockHeader,
cliqueSigner: Uint8Array,
): Uint8Array {
Expand All @@ -148,7 +148,7 @@ export function retrieveCliqueBlockExtraData(
;(header.extraData as any) = concatBytes(header.extraData, new Uint8Array(remainingLength))
}

requireClique(header, 'cliqueSealBlock')
requireClique(header, 'generateCliqueBlockExtraData')

const ecSignFunction = header.common.customCrypto?.ecsign ?? ecsign
const signature = ecSignFunction(cliqueSigHash(header), cliqueSigner)
Expand Down
6 changes: 3 additions & 3 deletions packages/block/src/constructors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
isHexString,
} from '@ethereumjs/util'

import { retrieveCliqueBlockExtraData } from './consensus/clique.js'
import { generateCliqueBlockExtraData } from './consensus/clique.js'
import { createBlockFromRpc } from './from-rpc.js'
import {
genRequestsTrieRoot,
Expand Down Expand Up @@ -526,7 +526,7 @@ export function createSealedCliqueBlock(
...opts,
...{ freeze: false, skipConsensusFormatValidation: true },
})
;(sealedCliqueBlock.header.extraData as any) = retrieveCliqueBlockExtraData(
;(sealedCliqueBlock.header.extraData as any) = generateCliqueBlockExtraData(
sealedCliqueBlock.header,
cliqueSigner,
)
Expand All @@ -550,7 +550,7 @@ export function createSealedCliqueBlockHeader(
...opts,
...{ skipConsensusFormatValidation: true },
})
;(sealedCliqueBlockHeader.extraData as any) = retrieveCliqueBlockExtraData(
;(sealedCliqueBlockHeader.extraData as any) = generateCliqueBlockExtraData(
sealedCliqueBlockHeader,
cliqueSigner,
)
Expand Down

0 comments on commit be12a25

Please sign in to comment.