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
Click to show internal directories.
Click to hide internal directories.