command

package
v0.0.0-...-a6cadb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2019 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDRESS_UNKNOWN = addressState(0)
	ADDRESS_EMPTY   = addressState(1)
	ADDRESS_FILLED  = addressState(2)
)

Variables

This section is empty.

Functions

func ApplyModelCommand

func ApplyModelCommand(
	command *model.Command,
	signerKey string,
	transactionId string,
	ba BlockchainAccess) error

func RunCommandForTest

func RunCommandForTest(c *Command, transactionId string, ba BlockchainAccess) error

Test running a command and check that only its input and output addresses are accessed.

Types

type BlockchainAccess

type BlockchainAccess interface {
	GetState(addresses []string) (map[string][]byte, error)
	SetState(pairs map[string][]byte) ([]string, error)
	AddEvent(eventType string, attributes []processor.Attribute, eventData []byte) error
}

func NewBlockchainStub

func NewBlockchainStub(eventHandler EventHandler, logger *log.Logger) BlockchainAccess

type Bootstrap

type Bootstrap struct {
	PriceMajorEditSettings               int32
	PriceMajorCreatePerson               int32
	PriceMajorChangePersonAuthorization  int32
	PriceMajorChangeJournalAuthorization int32
	PricePersonEdit                      int32
	PriceAuthorSubmitNewManuscript       int32
	PriceAuthorSubmitNewVersion          int32
	PriceAuthorAcceptAuthorship          int32
	PriceReviewerSubmit                  int32
	PriceEditorAllowManuscriptReview     int32
	PriceEditorRejectManuscript          int32
	PriceEditorPublishManuscript         int32
	PriceEditorAssignManuscript          int32
	PriceEditorCreateJournal             int32
	PriceEditorCreateVolume              int32
	PriceEditorEditJournal               int32
	PriceEditorAddColleague              int32
	PriceEditorAcceptDuty                int32
	Name                                 string
	Email                                string
}

type Command

type Command struct {
	InputAddresses  []string
	OutputAddresses []string
	CryptoIdentity  *CryptoIdentity
	Command         *model.Command
}

func GetBootstrapCommand

func GetBootstrapCommand(bootstrap *Bootstrap, cryptoIdentity *CryptoIdentity) *Command

func GetCommandEditorAcceptDuty

func GetCommandEditorAcceptDuty(
	journalId string,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandEditorInvite

func GetCommandEditorInvite(
	journalId,
	editorId,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandEditorResign

func GetCommandEditorResign(
	journalId string,
	signer string,
	cryptoIdentity *CryptoIdentity) *Command

func GetCommandJournalCreate

func GetCommandJournalCreate(
	jc *Journal,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetCommandJournalOmitDescription

func GetCommandJournalOmitDescription(
	journalId string,
	origDescriptionHash string,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandJournalUpdateAuthorization

func GetCommandJournalUpdateAuthorization(
	journalId string,
	makeSigned bool,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandJournalUpdateDescription

func GetCommandJournalUpdateDescription(
	journalId string,
	origDescriptionHash string,
	updatedDescription []byte,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandJournalUpdateProperties

func GetCommandJournalUpdateProperties(
	journalId string,
	orig,
	updated *Journal,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandManuscriptAcceptAuthorship

func GetCommandManuscriptAcceptAuthorship(
	manuscript *dao.Manuscript,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandManuscriptAllowReview

func GetCommandManuscriptAllowReview(
	threadId string,
	daoThreadReference []dao.ReferenceThreadItem,
	journalId string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandManuscriptAssign

func GetCommandManuscriptAssign(
	manuscriptAssign *ManuscriptAssign,
	journalId string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandManuscriptCreate

func GetCommandManuscriptCreate(
	manuscriptCreate *ManuscriptCreate,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetCommandManuscriptCreateNewVersion

func GetCommandManuscriptCreateNewVersion(
	manuscriptCreateNewVersion *ManuscriptCreateNewVersion,
	daoThreadReference []dao.ReferenceThreadItem,
	historicAuthors []string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetCommandManuscriptPublish

func GetCommandManuscriptPublish(
	manuscriptJudge *ManuscriptJudge,
	journalId string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandManuscriptReject

func GetCommandManuscriptReject(
	manuscriptJudge *ManuscriptJudge,
	journalId string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandPersonOmitBiography

func GetCommandPersonOmitBiography(
	personId string,
	origBiographyHash string,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandPersonUpdateBiography

func GetCommandPersonUpdateBiography(
	personId string,
	origBiographyHash string,
	updatedBiography []byte,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetCommandVolumeCreate

func GetCommandVolumeCreate(
	v *Volume,
	signer string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetCommandWriteNegativeReview

func GetCommandWriteNegativeReview(
	reviewCreate *ReviewCreate,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetCommandWritePositiveReview

func GetCommandWritePositiveReview(
	reviewCreate *ReviewCreate,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetPersonCreateCommand

func GetPersonCreateCommand(
	pc *PersonCreate,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) (*Command, string)

func GetPersonUpdateIncBalanceCommand

func GetPersonUpdateIncBalanceCommand(
	personId string,
	amount int32,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetPersonUpdatePropertiesCommand

func GetPersonUpdatePropertiesCommand(
	personId string,
	orig,
	updated *dao.PersonUpdate,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetPersonUpdateSetMajorCommand

func GetPersonUpdateSetMajorCommand(
	personId,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetPersonUpdateSetSignedCommand

func GetPersonUpdateSetSignedCommand(
	personId,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetPersonUpdateUnsetMajorCommand

func GetPersonUpdateUnsetMajorCommand(
	personId,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetPersonUpdateUnsetSignedCommand

func GetPersonUpdateUnsetSignedCommand(
	personId,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

func GetSettingsUpdateCommand

func GetSettingsUpdateCommand(
	orig,
	updated *dao.Settings,
	signerId string,
	cryptoIdentity *CryptoIdentity,
	price int32) *Command

type CryptoIdentity

type CryptoIdentity struct {
	PublicKeyStr string
	PublicKey    signing.PublicKey
	PrivateKey   signing.PrivateKey
}

type EventHandler

type EventHandler func(*events_pb2.Event, *log.Logger) error

type Journal

type Journal struct {
	Title string
}

type ManuscriptAssign

type ManuscriptAssign struct {
	ManuscriptId string
	VolumeId     string
	FirstPage    string
	LastPage     string
}

type ManuscriptCreate

type ManuscriptCreate struct {
	TheManuscript []byte
	CommitMsg     string
	Title         string
	AuthorId      []string
	JournalId     string
}

type ManuscriptCreateNewVersion

type ManuscriptCreateNewVersion struct {
	TheManuscript        []byte
	CommitMsg            string
	Title                string
	AuthorId             []string
	PreviousManuscriptId string
	ThreadId             string
	JournalId            string
}

type ManuscriptJudge

type ManuscriptJudge struct {
	ManuscriptId string
	ReviewId     []string
}

type PersonCreate

type PersonCreate struct {
	PublicKey string
	Name      string
	Email     string
}

type ReviewCreate

type ReviewCreate struct {
	ManuscriptId string
	TheReview    []byte
}

type Volume

type Volume struct {
	JournalId              string
	Issue                  string
	LogicalPublicationTime int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL