Documentation ¶
Index ¶
- Constants
- Variables
- func CreateHelloTransaction(publicKey string, privateKey []byte, ip string) (tran string, ok bool)
- func GetRawTransactionType(rawData string) string
- func IsRedisError(err redisError) bool
- func PubkeyFromSeckey(privateKey []byte) []byte
- func VerifyApplicantTransaction(tran ApplicantTransaction) (transactionTime int64, statusCode int, ok bool)
- func VerifyHelloTransaction(tran HelloTransaction) (ok bool)
- func VerifySimpleTransaction(tran SimpleTransaction) (transactionTime int64, statusCode int, ok bool)
- func VerifyUATransaction(tran UATransaction) (transactionTime int64, statusCode int, ok bool)
- func VerifyUVTransaction(tran UVTransaction) (transactionTime int64, statusCode int, ok bool)
- func VerifyVoteTransaction(tran VoteTransaction) (transactionTime int64, statusCode int, ok bool)
- type ASResponse
- type AVSResponse
- type ApplicantTransaction
- type ApplicantTransactionForVerify
- type BHeightResponse
- type BalanceResponse
- type HelloTransaction
- type HelloTransactionForVerify
- type SimpleTransaction
- type SimpleTransactionForVerify
- type StakeResponse
- type StatisticsResponse
- type TranType
- type UATransaction
- type UATransactionForVerify
- type UVTransaction
- type UVTransactionForVerify
- type VSResponse
- type VersionResponse
- type VoteTransaction
- type VoteTransactionForVerify
Constants ¶
View Source
const ( StatusNotEnoughFunds = 600 + iota // NOT ENOUTH FUNDS StatusNotEnoughFundsForCommission // 601 NOT ENOUGH FUNDS FOR COMMISSION StatusTranNotFound // 602 TRANSACTION NOT FOUND StatusInternalServerError // 603 SOMETHING BAD HAPPEND StatusUnknownTranType // 604 UNKNOWN TRANSACTION TYPE StatusAttrNotFound_TT // 605 CAN NOT FIND ATTRIBUTE - TT StatusAttrNotFound_VERSION // 606 CAN NOT FIND ATTRIBUT - VERSION StatusAttrNotFound_SENDER // 607 CAN NOT FIND ATTRIBUTE - SENDER StatusAttrNotFound_RECEIVER // 608 CAN NOT FIND ATTRIBUTE - RECEIVER StatusAttrNotFound_TTOKEN // 609 CAN NOT FIND ATTRIBUTE - TTOKEN StatusAttrNotFound_CTOKEN // 610 CAN NOT FIND ATTRIBUTE - CTOKEN StatusAttrNotFound_TST // 611 CAN NOT FIND ATTRIBUTE - TST StatusAttrNotFound_SIGNATURE // 612 CAN NOT FIND ATTRIBUTE - SIGNATURE StatusAttrNotFound_KEY // 613 CAN NOT FIND ATTRIBUTE - KEY StatusAttrNotFound_SOURCE // 614 CAN NOT FIND ATTRIBUTE - SOURCE StatusAttrNotFound_PAIR // 615 CAN NOT FIND ATTRIBUTE - PAIR StatusAttrNotFound_TICKER // 616 CAN NOT FIND ATTRIBUTE - TICKER StatusWrongAttr_KEY // 617 WRONG ATTRIBUTE - KEY StatusWrongAttr_TT // 618 WRONG ATTRIBUTE - TT StatusWrongAttr_VERSION // 619 WRONG ATTRIBUTE - VERSION StatusWrongAttr_SENDER // 620 WRONG ATTRIBUTE - SENDER StatusWrongAttr_RECEIVER // 621 WRONG ATTRIBUTE - RECEIVER StatusWrongAttr_TST // 622 WRONG ATTRIBUTE - TST StatusWrongAttr_CTOKEN // 623 WRONG ATTRIBUTE - CTOKEN StatusWrongAttr_Signature // 624 WRONG ATTRIBUTE - SIGNATURE StatusSignVerifyError // 625 CAN'T VERIFY SIGNATURE StatusDontSendYourself // 626 YOU CAN'T SEND YOURSELF StatusTranFailed // 627 TRANSACTION FAILED StatusDataNotFound // 628 DATA NOT FOUND StatusWrongDataFormat // 629 WRONG DATA FORMAT StatusWrongAttr_TTOKEN // 630 WRONG ATTRIBUTE - TTOKEN StatusWrongAttr_BHEIGHT // 631 WRONG ATTRIBUTE - BHEIGHT StatusWrongAttr_IPADDR // 632 WRONG ATTRIBUTE - IPADDR StatusWrongAttr_VOTES // 633 WRONG ATTRIBUTE - VOTES StatusAttrNotFound_BHEIGHT // 634 CAN NOT FIND ATTRIBUTE - BHEIGHT StatusAttrNotFound_IPADDR // 635 CAN NOT FIND ATTRIBUTE - IPADDR StatusAttrNotFound_ADDRESS // 636 CAN NOT FIND ATTRIBUTE - ADDRESS StatusWrongAttr_ADDRESS // 637 WRONG ATTRIBUTE - ADDRESS )
View Source
const StatusOk = 200 // OK
Variables ¶
View Source
var ApplicantStructureFields = map[int]string{StatusWrongAttr_TT: "TT", StatusAttrNotFound_SENDER: "SENDER", StatusAttrNotFound_IPADDR: "IPADDR", StatusAttrNotFound_TST: "TST", StatusAttrNotFound_SIGNATURE: "SIGNATURE"}
View Source
var MandatoryTransactionFields = map[int]string{StatusWrongAttr_TT: "TT", StatusAttrNotFound_SENDER: "SENDER", StatusAttrNotFound_TST: "TST", StatusAttrNotFound_SIGNATURE: "SIGNATURE"}
View Source
var RequestBalanceFields = map[int]string{StatusAttrNotFound_TTOKEN: "TTOKEN", StatusAttrNotFound_SENDER: "SENDER"}
View Source
var RequestGetBlockFields = map[int]string{StatusAttrNotFound_BHEIGHT: "BHEIGHT"}
View Source
var RequestStakeFields = map[int]string{StatusAttrNotFound_SENDER: "SENDER"}
View Source
var RequestTranStatusFields = map[int]string{StatusAttrNotFound_KEY: "KEY"}
View Source
var RequestVSFields = map[int]string{StatusAttrNotFound_ADDRESS: "ADDRESS"}
View Source
var SimpleStructureFields = map[int]string{StatusWrongAttr_TT: "TT", StatusAttrNotFound_SENDER: "SENDER", StatusAttrNotFound_RECEIVER: "RECEIVER", StatusAttrNotFound_TTOKEN: "TTOKEN", StatusAttrNotFound_CTOKEN: "CTOKEN", StatusAttrNotFound_TST: "TST", StatusAttrNotFound_SIGNATURE: "SIGNATURE"}
Functions ¶
func CreateHelloTransaction ¶
func GetRawTransactionType ¶
func IsRedisError ¶
func IsRedisError(err redisError) bool
func PubkeyFromSeckey ¶
func VerifyApplicantTransaction ¶
func VerifyApplicantTransaction(tran ApplicantTransaction) (transactionTime int64, statusCode int, ok bool)
func VerifyHelloTransaction ¶
func VerifyHelloTransaction(tran HelloTransaction) (ok bool)
func VerifySimpleTransaction ¶
func VerifySimpleTransaction(tran SimpleTransaction) (transactionTime int64, statusCode int, ok bool)
func VerifyUATransaction ¶
func VerifyUATransaction(tran UATransaction) (transactionTime int64, statusCode int, ok bool)
func VerifyUVTransaction ¶
func VerifyUVTransaction(tran UVTransaction) (transactionTime int64, statusCode int, ok bool)
func VerifyVoteTransaction ¶
func VerifyVoteTransaction(tran VoteTransaction) (transactionTime int64, statusCode int, ok bool)
Types ¶
type ASResponse ¶
type ASResponse struct {
APPLICANTS []string
}
type AVSResponse ¶
type ApplicantTransaction ¶
type ApplicantTransaction struct { TT string SENDER string IPADDR string TST string SIGNATURE string }
func ParseApplicantTransaction ¶
func ParseApplicantTransaction(rawData string) (ApplicantTransaction, error)
type BHeightResponse ¶
type BHeightResponse struct {
BHEIGHT string
}
type BalanceResponse ¶
type HelloTransaction ¶
func ParseHelloTransaction ¶
func ParseHelloTransaction(rawData string) (HelloTransaction, error)
type SimpleTransaction ¶
type SimpleTransaction struct { TT string SENDER string RECEIVER string TTOKEN string CTOKEN string TST string SIGNATURE string }
func ParseSimpleTransaction ¶
func ParseSimpleTransaction(rawData string) (SimpleTransaction, error)
type StakeResponse ¶
type StatisticsResponse ¶
type UATransaction ¶
func ParseUATransaction ¶
func ParseUATransaction(rawData string) (UATransaction, error)
type UATransactionForVerify ¶
type UVTransaction ¶
func ParseUVTransaction ¶
func ParseUVTransaction(rawData string) (UVTransaction, error)
type UVTransactionForVerify ¶
type VSResponse ¶
type VSResponse struct {
VOTES string
}
type VersionResponse ¶
type VersionResponse struct {
VERSION string
}
type VoteTransaction ¶
type VoteTransaction struct { TT string SENDER string RECEIVER string VOTES string TST string SIGNATURE string }
func ParseVoteTransaction ¶
func ParseVoteTransaction(rawData string) (VoteTransaction, error)
Click to show internal directories.
Click to hide internal directories.