Skip to content

Commit

Permalink
Polish docs
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Jul 1, 2024
1 parent fd6893b commit 229ff65
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/db/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func (mp *mergeProcessor) mergeComposites(ctx context.Context) error {
}

// processBlock merges the block and its children to the datastore and sets the head accordingly.
// If onlyHeads is true, it will skip merging and update only the heads.
func (mp *mergeProcessor) processBlock(
ctx context.Context,
block *coreblock.Block,
Expand Down
1 change: 1 addition & 0 deletions internal/encryption/nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func generateTestNonce() ([]byte, error) {
func init() {
arg := os.Args[0]
// If the binary is a test binary, use a deterministic nonce.
// TODO: We should try to find a better way to detect this https://github.com/sourcenetwork/defradb/issues/2801
if strings.HasSuffix(arg, ".test") || strings.Contains(arg, "/defradb/tests/") {
generateNonceFunc = generateTestNonce
generateEncryptionKeyFunc = generateTestEncryptionKey
Expand Down
1 change: 1 addition & 0 deletions internal/merkle/clock/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func encryptBlock(ctx context.Context, block *coreblock.Block) (*coreblock.Block
}

// ProcessBlock merges the delta CRDT and updates the state accordingly.
// If onlyHeads is true, it will skip merging and update only the heads.
func (mc *MerkleClock) ProcessBlock(
ctx context.Context,
block *coreblock.Block,
Expand Down
4 changes: 2 additions & 2 deletions internal/merkle/crdt/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ package merklecrdt
import "github.com/sourcenetwork/defradb/client"

// DocField is a struct that holds the document ID and the field value.
// This is used to a link between the document and the field value.
// For example, to check if the field value need be encrypted depending on the document-level
// This is used to have a link between the document and the field value.
// For example, to check if the field value needs to be encrypted depending on the document-level
// encryption is enabled or not.
type DocField struct {
DocID string
Expand Down
4 changes: 2 additions & 2 deletions internal/request/graphql/schema/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,8 +1051,8 @@ func (g *Generator) GenerateMutationInputForGQLType(obj *gql.Object) ([]*gql.Fie
Description: createDocumentDescription,
Type: obj,
Args: gql.FieldConfigArgument{
"input": schemaTypes.NewArgConfig(mutationInput, "Create field values"),
"inputs": schemaTypes.NewArgConfig(gql.NewList(mutationInput), "Create field values"),
"input": schemaTypes.NewArgConfig(mutationInput, "Create a "+obj.Name()+" document"),
"inputs": schemaTypes.NewArgConfig(gql.NewList(mutationInput), "Create "+obj.Name()+" documents"),
"encrypt": schemaTypes.NewArgConfig(gql.Boolean, encryptArgDescription),
},
}
Expand Down

0 comments on commit 229ff65

Please sign in to comment.