Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed seq and prev from block and test for exportChainStream #5704

Draft
wants to merge 1 commit into
base: jason-rpc-deprecated
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions ironfish/src/rpc/routes/chain/exportChainStream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('Route chain/exportChainStream', () => {
block: {
head: true,
hash: blockA1.header.hash.toString('hex'),
prev: chain.genesis.hash.toString('hex'),
seq: 2,
previousBlockHash: chain.genesis.hash.toString('hex'),
sequence: 2,
},
},
})
Expand Down
12 changes: 0 additions & 12 deletions ironfish/src/rpc/routes/chain/exportChainStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ export type ExportChainStreamResponse = {
main: boolean
head: boolean
latest: boolean
/**
* @deprecated Please use sequence instead
*/
seq: number
/**
* @deprecated Please use previousBlockHash instead
*/
prev: string
}
}

Expand All @@ -49,9 +41,7 @@ export const ExportChainStreamResponseSchema: yup.ObjectSchema<ExportChainStream
block: RpcBlockHeaderSchema.concat(
yup
.object({
seq: yup.number().defined(),
main: yup.boolean().defined(),
prev: yup.string().defined(),
head: yup.boolean().defined(),
latest: yup.boolean().defined(),
})
Expand Down Expand Up @@ -84,8 +74,6 @@ routes.register<typeof ExportChainStreamRequestSchema, ExportChainStreamResponse
const blockResult = {
...serializeRpcBlockHeader(block),
main: isMain,
seq: block.sequence,
prev: block.previousBlockHash.toString('hex'),
head: block.hash.equals(node.chain.head.hash),
latest: block.hash.equals(node.chain.latest.hash),
}
Expand Down
1 change: 0 additions & 1 deletion ironfish/src/rpc/routes/chain/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { RpcBlock, RpcBlockHeader, RpcEncryptedNote, RpcTransaction } from './ty
export function serializeRpcBlockHeader(header: BlockHeader): RpcBlockHeader {
return {
hash: header.hash.toString('hex'),
previous: header.previousBlockHash.toString('hex'),
sequence: Number(header.sequence),
previousBlockHash: header.previousBlockHash.toString('hex'),
timestamp: header.timestamp.valueOf(),
Expand Down
5 changes: 0 additions & 5 deletions ironfish/src/rpc/routes/chain/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,11 @@ export type RpcBlockHeader = {
graffiti: string
work: string
noteSize: number | null
/**
* @deprecated Please use previousBlockHash instead
*/
previous: string
}

export const RpcBlockHeaderSchema: yup.ObjectSchema<RpcBlockHeader> = yup
.object({
hash: yup.string().defined(),
previous: yup.string().defined(),
sequence: yup.number().defined(),
previousBlockHash: yup.string().defined(),
timestamp: yup.number().defined(),
Expand Down
Loading