Skip to content

Commit

Permalink
client(consensus/grandpa): implement grandpaDb and environment types (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jimjbrettj authored and timwu20 committed Apr 19, 2024
1 parent c5863a2 commit a0d4e4d
Show file tree
Hide file tree
Showing 10 changed files with 2,706 additions and 729 deletions.
26 changes: 26 additions & 0 deletions client/api/backend.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2023 ChainSafe Systems (ON)
// SPDX-License-Identifier: LGPL-3.0-only

package api

type Key []byte

type KeyValue struct {
Key Key
Value []byte
}

// AuxStore is part of the substrate backend.
// Provides access to an auxiliary database.
//
// This is a simple global database not aware of forks. Can be used for storing auxiliary
// information like total block weight/difficulty for fork resolution purposes as a common use
// case.
type AuxStore interface {
// Insert auxiliary data into key-Value store.
//
// Deletions occur after insertions.
Insert(insert []KeyValue, delete []Key) error
// Get Query auxiliary data from key-Value store.
Get(key Key) (*[]byte, error)
}
Loading

0 comments on commit a0d4e4d

Please sign in to comment.