Documentation ¶
Index ¶
- func GetMagicBytes() [32]byte
- type BlockMerkleRoot
- type BlockMerkleSnapshot
- type Bytes
- type Commitment
- type FeeInfo
- type HotShotBlockMerkleProof
- type L1BlockInfo
- type NamespaceProof
- type NsTable
- type RawCommitmentBuilder
- func (b *RawCommitmentBuilder) ArrayField(f string, array []Commitment) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) ConstantString(s string) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Field(f string, c Commitment) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Finalize() Commitment
- func (b *RawCommitmentBuilder) FixedSizeBytes(bytes Bytes) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) FixedSizeField(f string, bytes Bytes) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) OptionalField(f string, c *Commitment) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Uint256(n *U256) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Uint256Field(f string, n *U256) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Uint64(n uint64) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) Uint64Field(f string, n uint64) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) VarSizeBytes(bytes Bytes) *RawCommitmentBuilder
- func (b *RawCommitmentBuilder) VarSizeField(f string, bytes Bytes) *RawCommitmentBuilder
- type Signature
- type TaggedBase64
- type Transaction
- type TransactionQueryData
- type U256
- type U256Decimal
- type Version
- type VidCommon
- type VidCommonQueryData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMagicBytes ¶
func GetMagicBytes() [32]byte
Types ¶
type BlockMerkleRoot ¶
type BlockMerkleRoot = Commitment
type BlockMerkleSnapshot ¶
type BlockMerkleSnapshot struct { Root BlockMerkleRoot Height uint64 }
type Bytes ¶
type Bytes []byte
A bytes type which serializes to JSON as an array, rather than a base64 string. This ensures compatibility with the Espresso APIs.
func (Bytes) MarshalJSON ¶
func (*Bytes) UnmarshalJSON ¶
type Commitment ¶
type Commitment [32]byte
func CommitmentFromUint256 ¶
func CommitmentFromUint256(n *U256) (Commitment, error)
func (Commitment) Equals ¶
func (c Commitment) Equals(other Commitment) bool
func (Commitment) Uint256 ¶
func (c Commitment) Uint256() *U256
type FeeInfo ¶
type FeeInfo struct { Account common.Address `json:"account"` Amount U256Decimal `json:"amount"` }
func (*FeeInfo) Commit ¶
func (self *FeeInfo) Commit() Commitment
type HotShotBlockMerkleProof ¶
type HotShotBlockMerkleProof struct {
Proof json.RawMessage `json:"proof"`
}
func (*HotShotBlockMerkleProof) Verify ¶
func (p *HotShotBlockMerkleProof) Verify(root BlockMerkleRoot) (uint64, error)
Validates a block merkle proof, returning the validated HotShot block height. This is mocked until we have real merkle tree snapshot support.
type L1BlockInfo ¶
type L1BlockInfo struct { Number uint64 `json:"number"` Timestamp U256 `json:"timestamp"` Hash common.Hash `json:"hash"` }
func (*L1BlockInfo) Commit ¶
func (self *L1BlockInfo) Commit() Commitment
func (*L1BlockInfo) UnmarshalJSON ¶
func (i *L1BlockInfo) UnmarshalJSON(b []byte) error
type NamespaceProof ¶
type NamespaceProof = json.RawMessage
type NsTable ¶
type NsTable struct {
Bytes Bytes `json:"bytes"`
}
func (*NsTable) Commit ¶
func (self *NsTable) Commit() Commitment
func (*NsTable) UnmarshalJSON ¶
type RawCommitmentBuilder ¶
type RawCommitmentBuilder struct {
// contains filtered or unexported fields
}
func NewRawCommitmentBuilder ¶
func NewRawCommitmentBuilder(name string) *RawCommitmentBuilder
func (*RawCommitmentBuilder) ArrayField ¶
func (b *RawCommitmentBuilder) ArrayField(f string, array []Commitment) *RawCommitmentBuilder
func (*RawCommitmentBuilder) ConstantString ¶
func (b *RawCommitmentBuilder) ConstantString(s string) *RawCommitmentBuilder
Append a constant string to the running hash.
WARNING: The string `s` must be a constant. This function does not encode the length of `s` in the hash, which can lead to domain collisions when different strings with different lengths are used depending on the input object.
func (*RawCommitmentBuilder) Field ¶
func (b *RawCommitmentBuilder) Field(f string, c Commitment) *RawCommitmentBuilder
Include a named field of another committable type.
func (*RawCommitmentBuilder) Finalize ¶
func (b *RawCommitmentBuilder) Finalize() Commitment
func (*RawCommitmentBuilder) FixedSizeBytes ¶
func (b *RawCommitmentBuilder) FixedSizeBytes(bytes Bytes) *RawCommitmentBuilder
Append a fixed size byte array to the running hash.
WARNING: Go's type system cannot express the requirement that `bytes` is a fixed size array of any size. The best we can do is take a dynamically sized slice. However, this function uses a fixed-size encoding; namely, it does not encode the length of `bytes` in the hash, which can lead to domain collisions when this function is called with a slice which can have different lengths depending on the input object.
The caller must ensure that this function is only used with slices whose length is statically determined by the type being committed to.
func (*RawCommitmentBuilder) FixedSizeField ¶
func (b *RawCommitmentBuilder) FixedSizeField(f string, bytes Bytes) *RawCommitmentBuilder
Include a named field of fixed length in the hash.
WARNING: Go's type system cannot express the requirement that `bytes` is a fixed size array of any size. The best we can do is take a dynamically sized slice. However, this function uses a fixed-size encoding; namely, it does not encode the length of `bytes` in the hash, which can lead to domain collisions when this function is called with a slice which can have different lengths depending on the input object.
The caller must ensure that this function is only used with slices whose length is statically determined by the type being committed to.
func (*RawCommitmentBuilder) OptionalField ¶
func (b *RawCommitmentBuilder) OptionalField(f string, c *Commitment) *RawCommitmentBuilder
func (*RawCommitmentBuilder) Uint256 ¶
func (b *RawCommitmentBuilder) Uint256(n *U256) *RawCommitmentBuilder
Include a value of type `uint256` in the hash.
func (*RawCommitmentBuilder) Uint256Field ¶
func (b *RawCommitmentBuilder) Uint256Field(f string, n *U256) *RawCommitmentBuilder
Include a named field of type `uint256` in the hash.
func (*RawCommitmentBuilder) Uint64 ¶
func (b *RawCommitmentBuilder) Uint64(n uint64) *RawCommitmentBuilder
Include a value of type `uint64` in the hash.
func (*RawCommitmentBuilder) Uint64Field ¶
func (b *RawCommitmentBuilder) Uint64Field(f string, n uint64) *RawCommitmentBuilder
Include a named field of type `uint64` in the hash.
func (*RawCommitmentBuilder) VarSizeBytes ¶
func (b *RawCommitmentBuilder) VarSizeBytes(bytes Bytes) *RawCommitmentBuilder
Include a byte array whose length can be dynamic to the running hash.
func (*RawCommitmentBuilder) VarSizeField ¶
func (b *RawCommitmentBuilder) VarSizeField(f string, bytes Bytes) *RawCommitmentBuilder
Include a named field of dynamic length in the hash.
type TaggedBase64 ¶
type TaggedBase64 = tagged_base64.TaggedBase64
type Transaction ¶
func (*Transaction) Commit ¶
func (self *Transaction) Commit() Commitment
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(b []byte) error
type TransactionQueryData ¶
type TransactionQueryData struct { Transaction Transaction `json:"transaction"` Hash *TaggedBase64 `json:"hash"` Index uint64 `json:"index"` Proof json.RawMessage `json:"proof"` BlockHash *TaggedBase64 `json:"block_hash"` BlockHeight uint64 `json:"block_height"` }
type U256 ¶
A BigInt type which serializes to JSON a a hex string. This ensures compatibility with the Espresso APIs.
func (U256) MarshalJSON ¶
func (*U256) ToDecimal ¶
func (i *U256) ToDecimal() *U256Decimal
func (*U256) UnmarshalJSON ¶
type U256Decimal ¶
A readable decimal format for U256. Please use the struct `U256` to initialize the number first and use the `ToDecimal` to convert.
func (U256Decimal) MarshalJSON ¶
func (i U256Decimal) MarshalJSON() ([]byte, error)
func (*U256Decimal) ToU256 ¶
func (i *U256Decimal) ToU256() *U256
func (*U256Decimal) UnmarshalJSON ¶
func (i *U256Decimal) UnmarshalJSON(in []byte) error
type VidCommon ¶
type VidCommon = json.RawMessage
type VidCommonQueryData ¶
type VidCommonQueryData struct { Height uint64 `json:"height"` BlockHash *TaggedBase64 `json:"block_hash"` PayloadHash *TaggedBase64 `json:"payload_hash"` Common VidCommon `json:"common"` }