Documentation ¶
Index ¶
- Variables
- func InitElectionPriceCalculator(vochainURI string) (*electionprice.Calculator, error)
- func NewSigner(secret, creatorEmail string) (*ethereum.SignKeys, string, error)
- func OrganizationSigner(secret, creatorEmail, nonce string) (*ethereum.SignKeys, error)
- func SignMessage(message []byte, signer *ethereum.SignKeys) ([]byte, error)
- type Account
Constants ¶
This section is empty.
Variables ¶
var AllowedSignMessagesHash = map[string]*struct{}{ "55c85f40d49bf654adcd277bd44f91fb1ac51b680e34b9f0d022b96c4f91e5ea": nil, }
Functions ¶
func InitElectionPriceCalculator ¶
func InitElectionPriceCalculator(vochainURI string) (*electionprice.Calculator, error)
InitElectionPriceCalculator initializes the election price calculator with the factors from the Vochain. It returns the election price calculator or an error if it fails to get the factors.
func NewSigner ¶
OrganizationSigner calculates a signer for the organization and the nonce used to calculate the private key of thath signer. The private key is calculated using the SHA256 hash of the secret, the creator email and the nonce. It returns the signer, the nonce and an error if the private key calculation fails.
func OrganizationSigner ¶
OrganizationSigner calculates a signer for the organization using the SHA256 hash of the secret, the creator email and the nonce. It returns the signer and an error if the private key calculation fails. It allows to recalculate the signer using the same secret, creator email and nonce for an organization.
Types ¶
type Account ¶
type Account struct { TxCosts map[models.TxType]uint64 ElectionPriceCalc *electionprice.Calculator // contains filtered or unexported fields }
Account handles the account operations that include signing transactions, creating faucet packages, etc.
func New ¶
New creates a new account with the given private key and API endpoint. If the account doesn't exist, it creates a new one.
func (*Account) FaucetPackage ¶
FaucetPackage generates a faucet package for the given address and amount.