Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 2.88 KB

CONTRIBUTING.md

File metadata and controls

93 lines (67 loc) · 2.88 KB

Contributing

This file describes the process for contributing to seda-chain.

Starting

First and foremost, fork the repository. Then please read the developing instructions for setting up your environment.

Commits

Your commits must follow specific guidelines.

Signed Commits

Sign all commits with a GPG key. GitHub has extensive documentation on how to:

  • Create a new GPG key.
  • Add a GPG key to your GitHub.
  • Sign your commits.

Conventional Commits

All commits are to follow the Conventional Commits standard. Commit messages should always be meaningful.

Error Handling

If you already have an error you can return, just return it. If you would like to add context to the error, use errorsmod.Wrap() or errorsmod.Wrapf(). For instance:

import (
	errorsmod "cosmossdk.io/errors"
)

err := cdc.UnmarshalJSON(bz, &data)
if err != nil {
	return errorsmod.Wrapf(err, "failed to unmarshal %s genesis state", types.ModuleName)
}

If there is no error at hand, you need to create an error or make use of SDK errors. To create a new error, add an error in types/errors.go and return it. To make use of SDK errors, find an appropriate error from Cosmos SDK package's types/errors/errors.go and return it. For example, we return a ErrInvalidRequest error when there is a failure in preliminary validation of transaction request parameters.

import (
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
func (m *MsgCreateVestingAccount) ValidateBasic() error {
	if m.EndTime <= 0 {
		return sdkerrors.ErrInvalidRequest.Wrap("invalid end time")
	}
	return nil
}

Formatting and Cleanliness

Please run make lint before making a commit to format the code.

Creating a Pull Request

For creating the PR, please follow the instructions below.

  1. Firstly, please open a PR from your forked repo to the main branch of seda-chain.
  2. Please fill in the PR template that is there.
  3. Then assign it to yourself and anyone else who worked on the issue with you.
  4. Make sure all CI tests pass.
  5. Finally, please assign at least two reviewers to your PR: