Skip to content

Commit

Permalink
rpcv05 Update Block header and pending block header
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Oct 12, 2023
1 parent 9c36fa6 commit 820ddd6
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions rpc/types_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,8 @@ type Block struct {
}

type PendingBlock struct {
// ParentHash The hash of this block's parent
ParentHash *felt.Felt `json:"parent_hash"`
// Timestamp the time in which the block was created, encoded in Unix time
Timestamp uint64 `json:"timestamp"`
// SequencerAddress the StarkNet identity of the sequencer submitting this block
SequencerAddress *felt.Felt `json:"sequencer_address"`
// Transactions The transactions in this block
Transactions BlockTransactions `json:"transactions"`
PendingBlockHeader PendingBlockHeader
BlockTransactions BlockTransactions
}

type BlockTxHashes struct {
Expand All @@ -107,14 +101,8 @@ type BlockTxHashes struct {
}

type PendingBlockTxHashes struct {
// ParentHash The hash of this block's parent
ParentHash *felt.Felt `json:"parent_hash"`
// Timestamp the time in which the block was created, encoded in Unix time
Timestamp uint64 `json:"timestamp"`
// SequencerAddress the StarkNet identity of the sequencer submitting this block
SequencerAddress *felt.Felt `json:"sequencer_address"`
// Transactions The hashes of the transactions included in this block
Transactions []*felt.Felt `json:"transactions"`
PendingBlockHeader PendingBlockHeader
BlockTxHashes BlockTxHashes
}

type BlockHeader struct {
Expand All @@ -130,4 +118,28 @@ type BlockHeader struct {
Timestamp uint64 `json:"timestamp"`
// SequencerAddress the StarkNet identity of the sequencer submitting this block
SequencerAddress *felt.Felt `json:"sequencer_address"`
// The price of l1 gas in the block
L1GasPrice ResourcePrice `json:"l1_gas_price"`
// Semver of the current Starknet protocol
StarknetVersion string `json:"starknet_version"`
}

type PendingBlockHeader struct {
// ParentHash The hash of this block's parent
ParentHash *felt.Felt `json:"parent_hash"`
// Timestamp the time in which the block was created, encoded in Unix time
Timestamp uint64 `json:"timestamp"`
// SequencerAddress the StarkNet identity of the sequencer submitting this block
SequencerAddress *felt.Felt `json:"sequencer_address"`
// The price of l1 gas in the block
L1GasPrice ResourcePrice `json:"l1_gas_price"`
// Semver of the current Starknet protocol
StarknetVersion string `json:"starknet_version"`
}

type ResourcePrice struct {
// The price of one unit of the given resource, denominated in strk
PriceInStrk NumAsHex `json:"price_in_strk,omitempty"`
// The price of one unit of the given resource, denominated in wei
PriceInWei string `json:"price_in_wei"`
}

0 comments on commit 820ddd6

Please sign in to comment.