donatewithfeedback

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

DonateWithFeedback is a smart contract which handles donation account and log of feedback messages sent together with the donations

Index

Constants

View Source
const (
	// code of the 'donate' request
	RequestDonate = sctransaction.RequestCode(uint16(1))
	// code of the 'withdraw' request. It is protected (checks authorisation at the protocol level)
	RequestWithdraw = sctransaction.RequestCode(uint16(2) | sctransaction.RequestCodeProtected)

	// state vars
	// name of the feedback message log
	VarStateTheLog = "l"
	// largest donation so far
	VarStateMaxDonation = "maxd"
	// total donation so far
	VarStateTotalDonations = "total"

	// request arguments
	// variable containing feedback text
	VarReqFeedback = "f"
	// sum to withdraw with the 'withdraw' request
	VarReqWithdrawSum = "s"
)

main external constants

Variables

This section is empty.

Functions

This section is empty.

Types

type DonationInfo

type DonationInfo struct {
	Seq      int64
	Id       *sctransaction.RequestId
	When     time.Time // not marshaled, filled in from timestamp
	Amount   int64
	Sender   address.Address
	Feedback string // max 16 bit length
	Error    string
}

DonationInfo is a structure which contains one donation it is marshalled to the deterministic binary form and saves as one entry in the state

func DonationInfoFromBytes

func DonationInfoFromBytes(data []byte) (*DonationInfo, error)

func (*DonationInfo) Bytes

func (di *DonationInfo) Bytes() []byte

func (*DonationInfo) Read

func (di *DonationInfo) Read(r io.Reader) error

func (*DonationInfo) Write

func (di *DonationInfo) Write(w io.Writer) error

Directories

Path Synopsis
hard coded smart contract code implements DonateWithFeedback
hard coded smart contract code implements DonateWithFeedback

Jump to

Keyboard shortcuts

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