github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/merkletree/types.go (about)

     1  package merkletree
     2  
     3  // ResultCode represents the result code.
     4  type ResultCode int64
     5  
     6  const (
     7  	// Unspecified is the code for unspecified result.
     8  	Unspecified ResultCode = iota
     9  	// Success is the code for success result.
    10  	Success
    11  	// KeyNotFound is the code for key not found result.
    12  	KeyNotFound
    13  	// DBError is the code for DB error result.
    14  	DBError
    15  	// InternalError is the code for internal error result.
    16  	InternalError
    17  )
    18  
    19  // Proof is a proof generated on Get operation.
    20  type Proof struct {
    21  	// Root is the proof root.
    22  	Root []uint64
    23  	// Key is the proof key.
    24  	Key []uint64
    25  	// Value is the proof value.
    26  	Value []uint64
    27  }
    28  
    29  // UpdateProof is a proof generated on Set operation.
    30  type UpdateProof struct {
    31  	// OldRoot is the update proof old root.
    32  	OldRoot []uint64
    33  	// NewRoot is the update proof new root.
    34  	NewRoot []uint64
    35  	// Key is the update proof key.
    36  	Key []uint64
    37  	// NewValue is the update proof new value.
    38  	NewValue []uint64
    39  }
    40  
    41  // ProgramProof is a proof generated on GetProgram operation.
    42  type ProgramProof struct {
    43  	// Data is the program proof data.
    44  	Data []byte
    45  }