Documentation ¶
Index ¶
- Constants
- func AddSaturate(a uint64, b uint64) uint64
- func AddSaturate32(a uint32, b uint32) uint32
- func MulSaturate(a uint64, b uint64) uint64
- func Muldiv(a uint64, b uint64, c uint64) (res uint64, overflow bool)
- func OAdd(a uint64, b uint64) (res uint64, overflowed bool)
- func OAdd16(a uint16, b uint16) (res uint16, overflowed bool)
- func OAdd32(a uint32, b uint32) (res uint32, overflowed bool)
- func OMul(a uint64, b uint64) (res uint64, overflowed bool)
- func OSub(a uint64, b uint64) (res uint64, overflowed bool)
- func OSub32(a uint32, b uint32) (res uint32, overflowed bool)
- func OneTimeIDForRound(round Round, keyDilution uint64) crypto.OneTimeSignatureIdentifier
- func SubSaturate(a uint64, b uint64) uint64
- func SubSaturate32(a uint32, b uint32) uint32
- type AccountData
- func (_ *AccountData) CanMarshalMsg(z interface{}) bool
- func (_ *AccountData) CanUnmarshalMsg(z interface{}) bool
- func (u *AccountData) ClearOnlineState()
- func (u AccountData) IsZero() bool
- func (z *AccountData) MarshalMsg(b []byte) (o []byte)
- func (u AccountData) MinBalance(proto *config.ConsensusParams) (res MicroNovas)
- func (u AccountData) Money(proto config.ConsensusParams, rewardsLevel uint64) (money MicroNovas, rewards MicroNovas)
- func (z *AccountData) MsgIsZero() bool
- func (z *AccountData) Msgsize() (s int)
- func (u AccountData) NormalizedOnlineBalance(proto config.ConsensusParams) uint64
- func (u AccountData) OnlineAccountData() OnlineAccountData
- func (z *AccountData) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (u AccountData) WithUpdatedRewards(proto config.ConsensusParams, rewardsLevel uint64) AccountData
- type AccountDetail
- type Address
- func (_ *Address) CanMarshalMsg(z interface{}) bool
- func (_ *Address) CanUnmarshalMsg(z interface{}) bool
- func (addr Address) GetChecksum() []byte
- func (addr Address) GetUserAddress() string
- func (addr Address) IsZero() bool
- func (z *Address) MarshalMsg(b []byte) []byte
- func (addr Address) MarshalText() ([]byte, error)
- func (z *Address) MsgIsZero() bool
- func (z *Address) Msgsize() int
- func (addr Address) String() string
- func (z *Address) UnmarshalMsg(bts []byte) ([]byte, error)
- func (addr *Address) UnmarshalText(text []byte) error
- type AppIndex
- func (app AppIndex) Address() Address
- func (_ AppIndex) CanMarshalMsg(z interface{}) bool
- func (_ *AppIndex) CanUnmarshalMsg(z interface{}) bool
- func (z AppIndex) MarshalMsg(b []byte) (o []byte)
- func (z AppIndex) MsgIsZero() bool
- func (z AppIndex) Msgsize() (s int)
- func (app AppIndex) ToBeHashed() (protocol.HashID, []byte)
- func (z *AppIndex) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AppLocalState
- func (_ *AppLocalState) CanMarshalMsg(z interface{}) bool
- func (_ *AppLocalState) CanUnmarshalMsg(z interface{}) bool
- func (al *AppLocalState) Clone() (res AppLocalState)
- func (z *AppLocalState) MarshalMsg(b []byte) (o []byte)
- func (z *AppLocalState) MsgIsZero() bool
- func (z *AppLocalState) Msgsize() (s int)
- func (z *AppLocalState) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AppParams
- func (_ *AppParams) CanMarshalMsg(z interface{}) bool
- func (_ *AppParams) CanUnmarshalMsg(z interface{}) bool
- func (ap *AppParams) Clone() (res AppParams)
- func (z *AppParams) MarshalMsg(b []byte) (o []byte)
- func (z *AppParams) MsgIsZero() bool
- func (z *AppParams) Msgsize() (s int)
- func (z *AppParams) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetHolding
- func (_ *AssetHolding) CanMarshalMsg(z interface{}) bool
- func (_ *AssetHolding) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetHolding) MarshalMsg(b []byte) (o []byte)
- func (z *AssetHolding) MsgIsZero() bool
- func (z *AssetHolding) Msgsize() (s int)
- func (z *AssetHolding) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetIndex
- func (_ AssetIndex) CanMarshalMsg(z interface{}) bool
- func (_ *AssetIndex) CanUnmarshalMsg(z interface{}) bool
- func (z AssetIndex) MarshalMsg(b []byte) (o []byte)
- func (z AssetIndex) MsgIsZero() bool
- func (z AssetIndex) Msgsize() (s int)
- func (z *AssetIndex) UnmarshalMsg(bts []byte) (o []byte, err error)
- type AssetParams
- func (_ *AssetParams) CanMarshalMsg(z interface{}) bool
- func (_ *AssetParams) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetParams) MarshalMsg(b []byte) (o []byte)
- func (z *AssetParams) MsgIsZero() bool
- func (z *AssetParams) Msgsize() (s int)
- func (z *AssetParams) UnmarshalMsg(bts []byte) (o []byte, err error)
- type BalanceDetail
- type BalanceRecord
- func (_ *BalanceRecord) CanMarshalMsg(z interface{}) bool
- func (_ *BalanceRecord) CanUnmarshalMsg(z interface{}) bool
- func (z *BalanceRecord) MarshalMsg(b []byte) (o []byte)
- func (z *BalanceRecord) MsgIsZero() bool
- func (z *BalanceRecord) Msgsize() (s int)
- func (u BalanceRecord) ToBeHashed() (protocol.HashID, []byte)
- func (z *BalanceRecord) UnmarshalMsg(bts []byte) (o []byte, err error)
- type CreatableIndex
- func (_ CreatableIndex) CanMarshalMsg(z interface{}) bool
- func (_ *CreatableIndex) CanUnmarshalMsg(z interface{}) bool
- func (z CreatableIndex) MarshalMsg(b []byte) (o []byte)
- func (z CreatableIndex) MsgIsZero() bool
- func (z CreatableIndex) Msgsize() (s int)
- func (z *CreatableIndex) UnmarshalMsg(bts []byte) (o []byte, err error)
- type CreatableLocator
- type CreatableType
- func (_ CreatableType) CanMarshalMsg(z interface{}) bool
- func (_ *CreatableType) CanUnmarshalMsg(z interface{}) bool
- func (z CreatableType) MarshalMsg(b []byte) (o []byte)
- func (z CreatableType) MsgIsZero() bool
- func (z CreatableType) Msgsize() (s int)
- func (z *CreatableType) UnmarshalMsg(bts []byte) (o []byte, err error)
- type DeltaAction
- func (_ DeltaAction) CanMarshalMsg(z interface{}) bool
- func (_ *DeltaAction) CanUnmarshalMsg(z interface{}) bool
- func (z DeltaAction) MarshalMsg(b []byte) (o []byte)
- func (z DeltaAction) MsgIsZero() bool
- func (z DeltaAction) Msgsize() (s int)
- func (z *DeltaAction) UnmarshalMsg(bts []byte) (o []byte, err error)
- type MicroNovas
- func MulAIntSaturate(a MicroNovas, b int) MicroNovas
- func OAddA(a MicroNovas, b MicroNovas) (res MicroNovas, overflowed bool)
- func OSubA(a MicroNovas, b MicroNovas) (res MicroNovas, overflowed bool)
- func PendingRewards(ot *OverflowTracker, proto config.ConsensusParams, microNovas MicroNovas, ...) MicroNovas
- func (MicroNovas) CanMarshalMsg(z interface{}) bool
- func (*MicroNovas) CanUnmarshalMsg(z interface{}) bool
- func (a *MicroNovas) CodecDecodeSelf(dec *codec.Decoder)
- func (a MicroNovas) CodecEncodeSelf(enc *codec.Encoder)
- func (a MicroNovas) GreaterThan(b MicroNovas) bool
- func (a MicroNovas) IsZero() bool
- func (a MicroNovas) LessThan(b MicroNovas) bool
- func (a MicroNovas) MarshalMsg(b []byte) (o []byte)
- func (a MicroNovas) MsgIsZero() bool
- func (a MicroNovas) Msgsize() (s int)
- func (a MicroNovas) RewardUnits(proto config.ConsensusParams) uint64
- func (a MicroNovas) ToUint64() uint64
- func (a *MicroNovas) UnmarshalMsg(bts []byte) (o []byte, err error)
- type OnlineAccountData
- type OverflowTracker
- func (t *OverflowTracker) Add(a uint64, b uint64) uint64
- func (t *OverflowTracker) Add16(a uint16, b uint16) uint16
- func (t *OverflowTracker) AddA(a MicroNovas, b MicroNovas) MicroNovas
- func (t *OverflowTracker) AddR(a Round, b Round) Round
- func (t *OverflowTracker) Mul(a uint64, b uint64) uint64
- func (t *OverflowTracker) ScalarMulA(a MicroNovas, b uint64) MicroNovas
- func (t *OverflowTracker) Sub(a uint64, b uint64) uint64
- func (t *OverflowTracker) SubA(a MicroNovas, b MicroNovas) MicroNovas
- func (t *OverflowTracker) SubR(a Round, b Round) Round
- type Participant
- func (_ *Participant) CanMarshalMsg(z interface{}) bool
- func (_ *Participant) CanUnmarshalMsg(z interface{}) bool
- func (z *Participant) MarshalMsg(b []byte) (o []byte)
- func (z *Participant) MsgIsZero() bool
- func (z *Participant) Msgsize() (s int)
- func (p Participant) ToBeHashed() (protocol.HashID, []byte)
- func (z *Participant) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ParticipantsArray
- type Round
- func (_ Round) CanMarshalMsg(z interface{}) bool
- func (_ *Round) CanUnmarshalMsg(z interface{}) bool
- func (z Round) MarshalMsg(b []byte) (o []byte)
- func (z Round) MsgIsZero() bool
- func (z Round) Msgsize() (s int)
- func (round Round) RoundUpToMultipleOf(n Round) Round
- func (round Round) SubSaturate(x Round) Round
- func (z *Round) UnmarshalMsg(bts []byte) (o []byte, err error)
- type RoundInterval
- func (_ RoundInterval) CanMarshalMsg(z interface{}) bool
- func (_ *RoundInterval) CanUnmarshalMsg(z interface{}) bool
- func (z RoundInterval) MarshalMsg(b []byte) (o []byte)
- func (z RoundInterval) MsgIsZero() bool
- func (z RoundInterval) Msgsize() (s int)
- func (z *RoundInterval) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SortAddress
- type SortAppIndex
- type SortAssetIndex
- type SortString
- type SortUint64
- type StateDelta
- func (_ StateDelta) CanMarshalMsg(z interface{}) bool
- func (_ *StateDelta) CanUnmarshalMsg(z interface{}) bool
- func (sd StateDelta) Equal(o StateDelta) bool
- func (z StateDelta) MarshalMsg(b []byte) (o []byte)
- func (z StateDelta) MsgIsZero() bool
- func (z StateDelta) Msgsize() (s int)
- func (z *StateDelta) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (sd StateDelta) Valid(proto *config.ConsensusParams) error
- type StateSchema
- func (sm StateSchema) AddSchema(osm StateSchema) (out StateSchema)
- func (_ *StateSchema) CanMarshalMsg(z interface{}) bool
- func (_ *StateSchema) CanUnmarshalMsg(z interface{}) bool
- func (z *StateSchema) MarshalMsg(b []byte) (o []byte)
- func (sm StateSchema) MinBalance(proto *config.ConsensusParams) (res MicroNovas)
- func (z *StateSchema) MsgIsZero() bool
- func (z *StateSchema) Msgsize() (s int)
- func (sm StateSchema) NumEntries() (tot uint64)
- func (sm StateSchema) SubSchema(osm StateSchema) (out StateSchema)
- func (z *StateSchema) UnmarshalMsg(bts []byte) (o []byte, err error)
- type StateSchemas
- func (_ *StateSchemas) CanMarshalMsg(z interface{}) bool
- func (_ *StateSchemas) CanUnmarshalMsg(z interface{}) bool
- func (z *StateSchemas) MarshalMsg(b []byte) (o []byte)
- func (z *StateSchemas) MsgIsZero() bool
- func (z *StateSchemas) Msgsize() (s int)
- func (z *StateSchemas) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Status
- func (_ Status) CanMarshalMsg(z interface{}) bool
- func (_ *Status) CanUnmarshalMsg(z interface{}) bool
- func (z Status) MarshalMsg(b []byte) (o []byte)
- func (z Status) MsgIsZero() bool
- func (z Status) Msgsize() (s int)
- func (s Status) String() string
- func (z *Status) UnmarshalMsg(bts []byte) (o []byte, err error)
- type SupplyDetail
- type TealKeyValue
- func (_ TealKeyValue) CanMarshalMsg(z interface{}) bool
- func (_ *TealKeyValue) CanUnmarshalMsg(z interface{}) bool
- func (tk TealKeyValue) Clone() TealKeyValue
- func (z TealKeyValue) MarshalMsg(b []byte) (o []byte)
- func (z TealKeyValue) MsgIsZero() bool
- func (z TealKeyValue) Msgsize() (s int)
- func (tk TealKeyValue) ToStateSchema() (schema StateSchema, err error)
- func (z *TealKeyValue) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TealType
- func (_ TealType) CanMarshalMsg(z interface{}) bool
- func (_ *TealType) CanUnmarshalMsg(z interface{}) bool
- func (z TealType) MarshalMsg(b []byte) (o []byte)
- func (z TealType) MsgIsZero() bool
- func (z TealType) Msgsize() (s int)
- func (tt TealType) String() string
- func (z *TealType) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TealValue
- func (_ *TealValue) CanMarshalMsg(z interface{}) bool
- func (_ *TealValue) CanUnmarshalMsg(z interface{}) bool
- func (z *TealValue) MarshalMsg(b []byte) (o []byte)
- func (z *TealValue) MsgIsZero() bool
- func (z *TealValue) Msgsize() (s int)
- func (tv *TealValue) String() string
- func (tv *TealValue) ToValueDelta() (vd ValueDelta)
- func (z *TealValue) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ValueDelta
- func (_ *ValueDelta) CanMarshalMsg(z interface{}) bool
- func (_ *ValueDelta) CanUnmarshalMsg(z interface{}) bool
- func (z *ValueDelta) MarshalMsg(b []byte) (o []byte)
- func (z *ValueDelta) MsgIsZero() bool
- func (z *ValueDelta) Msgsize() (s int)
- func (vd *ValueDelta) ToTealValue() (value TealValue, ok bool)
- func (z *ValueDelta) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
const ( // Offline indicates that the associated account receives rewards but does not participate in the consensus. Offline Status = iota // Online indicates that the associated account participates in the consensus and receive rewards. Online // NotParticipating indicates that the associated account neither participates in the consensus, nor receives rewards. // Accounts that are marked as NotParticipating cannot change their status, but can receive and send Algos to other accounts. // Two special accounts that are defined as NotParticipating are the incentive pool (also know as rewards pool) and the fee sink. // These two accounts also have additional Algo transfer restrictions. NotParticipating // MaxEncodedAccountDataSize is a rough estimate for the worst-case scenario we're going to have of the account data and address serialized. // this number is verified by the TestEncodedAccountDataSize function. MaxEncodedAccountDataSize = 850000 // EncodedMaxAppLocalStates is the decoder limit for number of opted-in apps in a single account. // It is verified in TestEncodedAccountAllocationBounds to align with // config.Consensus[protocol.ConsensusCurrentVersion].MaxppsOptedIn EncodedMaxAppLocalStates = 64 // EncodedMaxAppParams is the decoder limit for number of created apps in a single account. // It is verified in TestEncodedAccountAllocationBounds to align with // config.Consensus[protocol.ConsensusCurrentVersion].MaxAppsCreated EncodedMaxAppParams = 64 // EncodedMaxKeyValueEntries is the decoder limit for the length of a key/value store. // It is verified in TestEncodedAccountAllocationBounds to align with // config.Consensus[protocol.ConsensusCurrentVersion].MaxLocalSchemaEntries and // config.Consensus[protocol.ConsensusCurrentVersion].MaxGlobalSchemaEntries EncodedMaxKeyValueEntries = 1024 )
계정의 상태(Offline, Online, NotParticipating)와 최대 저장할 수 있는 데이터(애셋포함)의 수를 상수로 정의
const (
// ErrIndexOutOfBound returned when an index is out of the array's bound
ErrIndexOutOfBound = "pos %d past end %d"
)
Variables ¶
This section is empty.
Functions ¶
func AddSaturate ¶
AddSaturate adds 2 values with saturation on overflow
func AddSaturate32 ¶
AddSaturate32 adds 2 uint32 values with saturation on overflow
func MulSaturate ¶
MulSaturate multiplies 2 values with saturation on overflow
func Muldiv ¶
Muldiv computes a*b/c. The overflow flag indicates that the result was 2^64 or greater.
func OAdd16 ¶
return이 왜 되지? => res와 overlfowed를 반환! OAdd16 adds 2 uint16 values with overflow detection
func OneTimeIDForRound ¶
func OneTimeIDForRound(round Round, keyDilution uint64) crypto.OneTimeSignatureIdentifier
OneTimeIDForRound maps a round to the identifier for which ephemeral key should be used for that round. keyDilution specifies the number of keys in the bottom-level of the two-level key structure.
OneTimeIDForRound는 라운드를 해당 라운드에 사용되어야 하는 임시 키의 식별자에 매핑합니다. keyDilution은 2레벨 키 구조의 최하위 레벨에 있는 키의 수를 지정합니다.
func SubSaturate ¶
SubSaturate subtracts 2 values with saturation on underflow
func SubSaturate32 ¶
SubSaturate32 subtracts 2 uint32 values with saturation on underflow
Types ¶
type AccountData ¶
type AccountData struct { // 계정의 상태 온라인, 오프라인, 참여안함 Status Status `codec:"onl"` // 계정이 보유 알고양 MicroNovas MicroNovas `codec:"algo"` // RewardsBase is used to implement rewards. // This is not meaningful for accounts with Status=NotParticipating. // // Every block assigns some amount of rewards (algos) to every // participating account. The amount is the product of how much // block.RewardsLevel increased from the previous block and // how many whole config.Protocol.RewardUnit algos this // account holds. // // For performance reasons, we do not want to walk over every // account to apply these rewards to AccountData.MicroNovas. Instead, // we defer applying the rewards until some other transaction // touches that participating account, and at that point, apply all // of the rewards to the account's AccountData.MicroNovas. // // For correctness, we need to be able to determine how many // total algos are present in the system, including deferred // rewards (deferred in the sense that they have not been // reflected in the account's AccountData.MicroNovas, as described // above). To compute this total efficiently, we avoid // compounding rewards (i.e., no rewards on rewards) until // they are applied to AccountData.MicroNovas. // // Mechanically, RewardsBase stores the block.RewardsLevel // whose rewards are already reflected in AccountData.MicroNovas. // If the account is Status=Offline or Status=Online, its // effective balance (if a transaction were to be issued // against this account) may be higher, as computed by // AccountData.Money(). That function calls // AccountData.WithUpdatedRewards() to apply the deferred // rewards to AccountData.MicroNovas. /* RewardsBase는 보상을 구현하는 데 사용됩니다. Status=NotParticipating인 계정에는 의미가 없습니다. 모든 블록은 참여하는 모든 계정에 일정량의 보상(알고)을 할당합니다. 금액은 이전 블록에서 증가한 block.RewardsLevel과 이 계정이 보유한 전체 config.Protocol.RewardUnit 알고리즘의 곱입니다. 성능상의 이유로 이러한 보상을 AccountData.MicroNovas에 적용하기 위해 모든 계정을 살펴보고 싶지는 않습니다. 대신 다른 트랜잭션이 참여 계정에 닿을 때까지 보상 적용을 연기하고 그 시점에서 모든 보상을 계정의 AccountData.MicroNovas에 적용합니다. 정확성을 위해 우리는 지연된 보상을 포함하여 시스템에 존재하는 총 알고리즘의 수를 결정할 수 있어야 합니다. 위에서 설명한 대로 계정의 AccountData.MicroNovas에 반영됨). 이 총계를 효율적으로 계산하기 위해 다음까지 보상을 합성하지 않습니다(즉, 보상에 대한 보상 없음). AccountData.MicroNovas에 적용됩니다. 기계적으로 RewardsBase는 이미 AccountData.MicroNovas에 보상이 반영된 block.RewardsLevel을 저장합니다. 계정이 Status=Offline 또는 Status=Online이면 AccountData.Money()에 의해 계산된 것처럼 유효 잔액(이 계정에 대해 트랜잭션이 발행된 경우)이 더 높을 수 있습니다. 이 함수는 AccountData.WithUpdatedRewards()를 호출하여 AccountData.MicroNovas에 지연된 보상을 적용합니다. */ RewardsBase uint64 `codec:"ebase"` // RewardedMicroNovas is used to track how many algos were given // to this account since the account was first created. // // This field is updated along with RewardBase; note that // it won't answer the question "how many algos did I make in // the past week". /* 계정이 생성된 이래로 얼마나 많은 알고를 보상으로 받았는지를 나타내는 값 RewardBase가 업데이트 되면 이 값도 업데이트 됨 */ RewardedMicroNovas MicroNovas `codec:"ern"` // 투표할 메시지에 대해 위조할 수 없는 서명을 생성 VoteID crypto.OneTimeSignatureVerifier `codec:"vote"` // 퍼블릭키 SelectionID crypto.VRFVerifier `codec:"sel"` //merklesignature.Signature의 검증자 StateProofID merklesignature.Verifier `codec:"stprf"` VoteFirstValid Round `codec:"voteFst"` VoteLastValid Round `codec:"voteLst"` VoteKeyDilution uint64 `codec:"voteKD"` // If this account created an asset, AssetParams stores // the parameters defining that asset. The params are indexed // by the Index of the AssetID; the Creator is this account's address. // // An account with any asset in AssetParams cannot be // closed, until the asset is destroyed. An asset can // be destroyed if this account holds AssetParams.Total units // of that asset (in the Assets array below). // // NOTE: do not modify this value in-place in existing AccountData // structs; allocate a copy and modify that instead. AccountData // is expected to have copy-by-value semantics. // 특정 애셋이 가지고 있는 매개변수들을 저장 AssetParams map[AssetIndex]AssetParams `codec:"apar,allocbound=encodedMaxAssetsPerAccount"` // Assets is the set of assets that can be held by this // account. Assets (i.e., slots in this map) are explicitly // added and removed from an account by special transactions. // The map is keyed by the AssetID, which is the address of // the account that created the asset plus a unique counter // to distinguish re-created assets. // // Each asset bumps the required MinBalance in this account. // // An account that creates an asset must have its own asset // in the Assets map until that asset is destroyed. // // NOTE: do not modify this value in-place in existing AccountData // structs; allocate a copy and modify that instead. AccountData // is expected to have copy-by-value semantics. // 해당계정이 보유하고 있는 애셋 정보 Assets map[AssetIndex]AssetHolding `codec:"asset,allocbound=encodedMaxAssetsPerAccount"` // AuthAddr is the address against which signatures/multisigs/logicsigs should be checked. // If empty, the address of the account whose AccountData is used. // A transaction may change an account's AuthAddr to "re-key" the account. // This allows key rotation, changing the members in a multisig, etc. // re-keying을 위한 주소 AuthAddr Address `codec:"spend"` // AppLocalStates stores the local states associated with any applications // that this account has opted in to. // 계정이 opt-in한 애플리케이션이 저장하는 로컬스테이트를 저장하는 맵 AppLocalStates map[AppIndex]AppLocalState `codec:"appl,allocbound=EncodedMaxAppLocalStates"` // AppParams stores the global parameters and state associated with any // applications that this account has created. // 계정이 opt-in한 애플리케이션의 파라미터를 저장하는 맵 AppParams map[AppIndex]AppParams `codec:"appp,allocbound=EncodedMaxAppParams"` // TotalAppSchema stores the sum of all of the LocalStateSchemas // and GlobalStateSchemas in this account (global for applications // we created local for applications we opted in to), so that we don't // have to iterate over all of them to compute MinBalance. // 계정에 연결된 로컬스테이트의 최대량 + 앱에 연결된 글로벌스테이트의 최대량 TotalAppSchema StateSchema `codec:"tsch"` // TotalExtraAppPages stores the extra length in pages (MaxAppProgramLen bytes per page) // requested for app program by this account // 이 어카운트와 연결된 app이 가지고 있는 총 페이지수 인듯(?) TotalExtraAppPages uint32 `codec:"teap"` // contains filtered or unexported fields }
AccountData contains the data associated with a given address.
This includes the account balance, cryptographic public keys, consensus delegation status, asset data, and application data.
AccountData는 주어진 주소에 해당하는 계정정보를 나타내는 구조체 계정잔액, 공개키, 합의 위임상태, 에셋 데이터와 앱 데이터를 가지고 있다.
func MakeAccountData ¶
func MakeAccountData(status Status, algos MicroNovas) AccountData
MakeAccountData returns a UserToken
func (*AccountData) CanMarshalMsg ¶
func (_ *AccountData) CanMarshalMsg(z interface{}) bool
func (*AccountData) CanUnmarshalMsg ¶
func (_ *AccountData) CanUnmarshalMsg(z interface{}) bool
func (*AccountData) ClearOnlineState ¶
func (u *AccountData) ClearOnlineState()
ClearOnlineState resets the account's fields to indicate that the account is an offline account
func (AccountData) IsZero ¶
func (u AccountData) IsZero() bool
IsZero checks if an AccountData value is the same as its zero value.
func (*AccountData) MarshalMsg ¶
func (z *AccountData) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (AccountData) MinBalance ¶
func (u AccountData) MinBalance(proto *config.ConsensusParams) (res MicroNovas)
MinBalance computes the minimum balance requirements for an account based on some consensus parameters. MinBalance should correspond roughly to how much storage the account is allowed to store on disk.
func (AccountData) Money ¶
func (u AccountData) Money(proto config.ConsensusParams, rewardsLevel uint64) (money MicroNovas, rewards MicroNovas)
Money returns the amount of MicroNovas associated with the user's account
func (*AccountData) MsgIsZero ¶
func (z *AccountData) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AccountData) Msgsize ¶
func (z *AccountData) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (AccountData) NormalizedOnlineBalance ¶
func (u AccountData) NormalizedOnlineBalance(proto config.ConsensusParams) uint64
NormalizedOnlineBalance returns a “normalized” balance for this account.
The normalization compensates for rewards that have not yet been applied, by computing a balance normalized to round 0. To normalize, we estimate the micronova balance that an account should have had at round 0, in order to end up at its current balance when rewards are included.
The benefit of the normalization procedure is that an account's normalized balance does not change over time (unlike the actual algo balance that includes rewards). This makes it possible to compare normalized balances between two accounts, to sort them, and get results that are close to what we would get if we computed the exact algo balance of the accounts at a given round number.
The normalization can lead to some inconsistencies in comparisons between account balances, because the growth rate of rewards for accounts depends on how recently the account has been touched (our rewards do not implement compounding). However, online accounts have to periodically renew participation keys, so the scale of the inconsistency is small.
func (AccountData) OnlineAccountData ¶
func (u AccountData) OnlineAccountData() OnlineAccountData
OnlineAccountData returns subset of AccountData as OnlineAccountData data structure. Account is expected to be Online otherwise its is cleared out
func (*AccountData) UnmarshalMsg ¶
func (z *AccountData) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
func (AccountData) WithUpdatedRewards ¶
func (u AccountData) WithUpdatedRewards(proto config.ConsensusParams, rewardsLevel uint64) AccountData
WithUpdatedRewards returns an updated number of algos in an AccountData to reflect rewards up to some rewards level.
type AccountDetail ¶
type AccountDetail struct { Address Address Algos MicroNovas Status Status }
AccountDetail encapsulates meaningful details about a given account, for external consumption
type Address ¶
Address is a unique identifier corresponding to ownership of money 주소는 돈의 소유권과 관련된 유니크한 식별자다
func UnmarshalChecksumAddress ¶
UnmarshalChecksumAddress tries to unmarshal the checksummed address string. Algorand strings addresses ( base32 encoded ) have a postamble which serves as the checksum of the address. When converted to an Address object representation, that checksum is dropped (after validation).
func (*Address) CanMarshalMsg ¶
func (*Address) CanUnmarshalMsg ¶
func (Address) GetChecksum ¶
GetChecksum returns the checksum as []byte Checksum in Algorand are the last 4 bytes of the shortAddress Hash. H(Address)[28:]
func (Address) GetUserAddress ¶
GetUserAddress returns the human-readable, checksummed version of the address
func (*Address) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Address) MarshalText ¶
MarshalText returns the address string as an array of bytes
func (*Address) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Address) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*Address) UnmarshalText ¶
UnmarshalText initializes the Address from an array of bytes.
type AppIndex ¶
type AppIndex uint64
AppIndex is the unique integer index of an application that can be used to look up the creator of the application, whose balance record contains the AppParams
func (AppIndex) CanMarshalMsg ¶
func (*AppIndex) CanUnmarshalMsg ¶
func (AppIndex) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (AppIndex) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (AppIndex) ToBeHashed ¶
ToBeHashed implements crypto.Hashable
type AppLocalState ¶
type AppLocalState struct { Schema StateSchema `codec:"hsch"` KeyValue TealKeyValue `codec:"tkv"` // contains filtered or unexported fields }
AppLocalState stores the LocalState associated with an application. It also stores a cached copy of the application's LocalStateSchema so that MinBalance requirements may be computed 1. without looking up the AppParams and 2. even if the application has been deleted
func (*AppLocalState) CanMarshalMsg ¶
func (_ *AppLocalState) CanMarshalMsg(z interface{}) bool
func (*AppLocalState) CanUnmarshalMsg ¶
func (_ *AppLocalState) CanUnmarshalMsg(z interface{}) bool
func (*AppLocalState) Clone ¶
func (al *AppLocalState) Clone() (res AppLocalState)
Clone returns a copy of some AppLocalState that may be modified without affecting the original
func (*AppLocalState) MarshalMsg ¶
func (z *AppLocalState) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AppLocalState) MsgIsZero ¶
func (z *AppLocalState) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AppLocalState) Msgsize ¶
func (z *AppLocalState) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AppLocalState) UnmarshalMsg ¶
func (z *AppLocalState) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AppParams ¶
type AppParams struct { ApprovalProgram []byte `codec:"approv,allocbound=config.MaxAvailableAppProgramLen"` ClearStateProgram []byte `codec:"clearp,allocbound=config.MaxAvailableAppProgramLen"` GlobalState TealKeyValue `codec:"gs"` StateSchemas ExtraProgramPages uint32 `codec:"epp"` // contains filtered or unexported fields }
AppParams stores the global information associated with an application
func (*AppParams) CanMarshalMsg ¶
func (*AppParams) CanUnmarshalMsg ¶
func (*AppParams) Clone ¶
Clone returns a copy of some AppParams that may be modified without affecting the original
func (*AppParams) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type AssetHolding ¶
type AssetHolding struct { Amount uint64 `codec:"a"` Frozen bool `codec:"f"` // contains filtered or unexported fields }
AssetHolding describes an asset held by an account.
func (*AssetHolding) CanMarshalMsg ¶
func (_ *AssetHolding) CanMarshalMsg(z interface{}) bool
func (*AssetHolding) CanUnmarshalMsg ¶
func (_ *AssetHolding) CanUnmarshalMsg(z interface{}) bool
func (*AssetHolding) MarshalMsg ¶
func (z *AssetHolding) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AssetHolding) MsgIsZero ¶
func (z *AssetHolding) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AssetHolding) Msgsize ¶
func (z *AssetHolding) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetHolding) UnmarshalMsg ¶
func (z *AssetHolding) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AssetIndex ¶
type AssetIndex uint64
AssetIndex is the unique integer index of an asset that can be used to look up the creator of the asset, whose balance record contains the AssetParams
func (AssetIndex) CanMarshalMsg ¶
func (_ AssetIndex) CanMarshalMsg(z interface{}) bool
func (*AssetIndex) CanUnmarshalMsg ¶
func (_ *AssetIndex) CanUnmarshalMsg(z interface{}) bool
func (AssetIndex) MarshalMsg ¶
func (z AssetIndex) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (AssetIndex) MsgIsZero ¶
func (z AssetIndex) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (AssetIndex) Msgsize ¶
func (z AssetIndex) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetIndex) UnmarshalMsg ¶
func (z *AssetIndex) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type AssetParams ¶
type AssetParams struct { // Total specifies the total number of units of this asset // created. Total uint64 `codec:"t"` // Decimals specifies the number of digits to display after the decimal // place when displaying this asset. A value of 0 represents an asset // that is not divisible, a value of 1 represents an asset divisible // into tenths, and so on. This value must be between 0 and 19 // (inclusive). Decimals uint32 `codec:"dc"` // DefaultFrozen specifies whether slots for this asset // in user accounts are frozen by default or not. DefaultFrozen bool `codec:"df"` // UnitName specifies a hint for the name of a unit of // this asset. UnitName string `codec:"un"` // AssetName specifies a hint for the name of the asset. AssetName string `codec:"an"` // URL specifies a URL where more information about the asset can be // retrieved URL string `codec:"au"` // MetadataHash specifies a commitment to some unspecified asset // metadata. The format of this metadata is up to the application. MetadataHash [32]byte `codec:"am"` // Manager specifies an account that is allowed to change the // non-zero addresses in this AssetParams. Manager Address `codec:"m"` // Reserve specifies an account whose holdings of this asset // should be reported as "not minted". Reserve Address `codec:"r"` // Freeze specifies an account that is allowed to change the // frozen state of holdings of this asset. Freeze Address `codec:"f"` // Clawback specifies an account that is allowed to take units // of this asset from any account. Clawback Address `codec:"c"` // contains filtered or unexported fields }
AssetParams describes the parameters of an asset.
func (*AssetParams) CanMarshalMsg ¶
func (_ *AssetParams) CanMarshalMsg(z interface{}) bool
func (*AssetParams) CanUnmarshalMsg ¶
func (_ *AssetParams) CanUnmarshalMsg(z interface{}) bool
func (*AssetParams) MarshalMsg ¶
func (z *AssetParams) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*AssetParams) MsgIsZero ¶
func (z *AssetParams) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*AssetParams) Msgsize ¶
func (z *AssetParams) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AssetParams) UnmarshalMsg ¶
func (z *AssetParams) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type BalanceDetail ¶
type BalanceDetail struct { Round Round TotalMoney MicroNovas OnlineMoney MicroNovas Accounts []AccountDetail }
BalanceDetail encapsulates meaningful details about the current balances of the ledger, for external consumption
type BalanceRecord ¶
type BalanceRecord struct { Addr Address `codec:"addr"` AccountData // contains filtered or unexported fields }
BalanceRecord pairs an account's address with its associated data.
func (*BalanceRecord) CanMarshalMsg ¶
func (_ *BalanceRecord) CanMarshalMsg(z interface{}) bool
func (*BalanceRecord) CanUnmarshalMsg ¶
func (_ *BalanceRecord) CanUnmarshalMsg(z interface{}) bool
func (*BalanceRecord) MarshalMsg ¶
func (z *BalanceRecord) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*BalanceRecord) MsgIsZero ¶
func (z *BalanceRecord) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*BalanceRecord) Msgsize ¶
func (z *BalanceRecord) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (BalanceRecord) ToBeHashed ¶
func (u BalanceRecord) ToBeHashed() (protocol.HashID, []byte)
ToBeHashed implements the crypto.Hashable interface
func (*BalanceRecord) UnmarshalMsg ¶
func (z *BalanceRecord) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CreatableIndex ¶
type CreatableIndex uint64
CreatableIndex represents either an AssetIndex or AppIndex, which come from the same namespace of indices as each other (both assets and apps are "creatables")
func (CreatableIndex) CanMarshalMsg ¶
func (_ CreatableIndex) CanMarshalMsg(z interface{}) bool
func (*CreatableIndex) CanUnmarshalMsg ¶
func (_ *CreatableIndex) CanUnmarshalMsg(z interface{}) bool
func (CreatableIndex) MarshalMsg ¶
func (z CreatableIndex) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (CreatableIndex) MsgIsZero ¶
func (z CreatableIndex) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (CreatableIndex) Msgsize ¶
func (z CreatableIndex) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CreatableIndex) UnmarshalMsg ¶
func (z *CreatableIndex) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type CreatableLocator ¶
type CreatableLocator struct { Type CreatableType Creator Address Index CreatableIndex }
CreatableLocator stores both the creator, whose balance record contains the asset/app parameters, and the creatable index, which is the key into those parameters
type CreatableType ¶
type CreatableType uint64
CreatableType is an enum representing whether or not a given creatable is an application or an asset
const ( // AssetCreatable is the CreatableType corresponding to assets // This value must be 0 to align with the applications database // upgrade. At migration time, we set the default 'ctype' column of the // creators table to 0 so that existing assets have the correct type. AssetCreatable CreatableType = 0 // AppCreatable is the CreatableType corresponds to apps AppCreatable CreatableType = 1 )
func (CreatableType) CanMarshalMsg ¶
func (_ CreatableType) CanMarshalMsg(z interface{}) bool
func (*CreatableType) CanUnmarshalMsg ¶
func (_ *CreatableType) CanUnmarshalMsg(z interface{}) bool
func (CreatableType) MarshalMsg ¶
func (z CreatableType) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (CreatableType) MsgIsZero ¶
func (z CreatableType) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (CreatableType) Msgsize ¶
func (z CreatableType) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CreatableType) UnmarshalMsg ¶
func (z *CreatableType) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type DeltaAction ¶
type DeltaAction uint64
DeltaAction is an enum of actions that may be performed when applying a delta to a TEAL key/value store
TEAL 키, 값 저장소에 사용하는 delta를 적용할 때 수행되는 행동들의 enum값이다.
const ( // SetBytesAction indicates that a TEAL byte slice should be stored at a key /* TEAL byte slice가 해당 key에 저장돼야 함 */ SetBytesAction DeltaAction = 1 // SetUintAction indicates that a Uint should be stored at a key /* Uint이 해당 key에 저장돼야 함 */ SetUintAction DeltaAction = 2 // DeleteAction indicates that the value for a particular key should be deleted /* key에 해당하는 value를 삭제! */ DeleteAction DeltaAction = 3 )
func (DeltaAction) CanMarshalMsg ¶
func (_ DeltaAction) CanMarshalMsg(z interface{}) bool
func (*DeltaAction) CanUnmarshalMsg ¶
func (_ *DeltaAction) CanUnmarshalMsg(z interface{}) bool
func (DeltaAction) MarshalMsg ¶
func (z DeltaAction) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (DeltaAction) MsgIsZero ¶
func (z DeltaAction) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (DeltaAction) Msgsize ¶
func (z DeltaAction) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*DeltaAction) UnmarshalMsg ¶
func (z *DeltaAction) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type MicroNovas ¶
type MicroNovas struct {
Raw uint64
}
MicroNovas is our unit of currency. It is wrapped in a struct to nudge developers to use an overflow-checking library for any arithmetic.
개발자들이 overflow체킹 라이브러리를 사용할 수 있도록 구조체로 감싼 알고랜드의 최소 통화단위
func MulAIntSaturate ¶
func MulAIntSaturate(a MicroNovas, b int) MicroNovas
MulAIntSaturate uses MulSaturate to multiply b (int) with a (MicroNovas)
func OAddA ¶
func OAddA(a MicroNovas, b MicroNovas) (res MicroNovas, overflowed bool)
OAddA adds 2 MicroNovas values with overflow tracking
func OSubA ¶
func OSubA(a MicroNovas, b MicroNovas) (res MicroNovas, overflowed bool)
OSubA subtracts b from a with overflow tracking
func PendingRewards ¶
func PendingRewards(ot *OverflowTracker, proto config.ConsensusParams, microNovas MicroNovas, rewardsBase uint64, rewardsLevel uint64) MicroNovas
PendingRewards computes the amount of rewards (in micronovas) that have yet to be added to the account balance.
func (MicroNovas) CanMarshalMsg ¶
func (MicroNovas) CanMarshalMsg(z interface{}) bool
CanMarshalMsg implements msgp.Marshaler
func (*MicroNovas) CanUnmarshalMsg ¶
func (*MicroNovas) CanUnmarshalMsg(z interface{}) bool
CanUnmarshalMsg implements msgp.Unmarshaler
func (*MicroNovas) CodecDecodeSelf ¶
func (a *MicroNovas) CodecDecodeSelf(dec *codec.Decoder)
CodecDecodeSelf implements codec.Selfer to decode MicroNovas as a simple int
func (MicroNovas) CodecEncodeSelf ¶
func (a MicroNovas) CodecEncodeSelf(enc *codec.Encoder)
CodecEncodeSelf implements codec.Selfer to encode MicroNovas as a simple int
func (MicroNovas) GreaterThan ¶
func (a MicroNovas) GreaterThan(b MicroNovas) bool
GreaterThan implements arithmetic comparison for MicroNovas
func (MicroNovas) IsZero ¶
func (a MicroNovas) IsZero() bool
IsZero implements arithmetic comparison for MicroNovas
func (MicroNovas) LessThan ¶
func (a MicroNovas) LessThan(b MicroNovas) bool
LessThan implements arithmetic comparison for MicroNovas
func (MicroNovas) MarshalMsg ¶
func (a MicroNovas) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (MicroNovas) MsgIsZero ¶
func (a MicroNovas) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (MicroNovas) Msgsize ¶
func (a MicroNovas) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (MicroNovas) RewardUnits ¶
func (a MicroNovas) RewardUnits(proto config.ConsensusParams) uint64
RewardUnits returns the number of reward units in some number of algos
func (MicroNovas) ToUint64 ¶
func (a MicroNovas) ToUint64() uint64
ToUint64 converts the amount of algos to uint64
func (*MicroNovas) UnmarshalMsg ¶
func (a *MicroNovas) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type OnlineAccountData ¶
type OnlineAccountData struct { // 보유 알고양 MicroNovasWithRewards MicroNovas // 투표할 메시지에 대해 위조할 수 없는 서명을 생성 VoteID crypto.OneTimeSignatureVerifier // 퍼블릭키 SelectionID crypto.VRFVerifier VoteFirstValid Round VoteLastValid Round VoteKeyDilution uint64 }
OnlineAccountData contains the voting information for a single account.
투표에 참여할 수 있는 온라인 계정정보를 가진 구조체
func (OnlineAccountData) KeyDilution ¶
func (u OnlineAccountData) KeyDilution(proto config.ConsensusParams) uint64
KeyDilution returns the key dilution for this account, returning the default key dilution if not explicitly specified.
func (OnlineAccountData) VotingStake ¶
func (u OnlineAccountData) VotingStake() MicroNovas
VotingStake returns the amount of MicroNovas associated with the user's account for the purpose of participating in the Algorand protocol. It assumes the caller has already updated rewards appropriately using WithUpdatedRewards().
type OverflowTracker ¶
type OverflowTracker struct {
Overflowed bool
}
OverflowTracker is used to track when an operation causes an overflow 언제 어떤 동작이 overflow를 일으크는지 여부를 추적하는 트래커
func (*OverflowTracker) Add ¶
func (t *OverflowTracker) Add(a uint64, b uint64) uint64
Add adds 2 values with overflow detection
func (*OverflowTracker) Add16 ¶
func (t *OverflowTracker) Add16(a uint16, b uint16) uint16
Add16 adds 2 uint16 values with overflow detection
func (*OverflowTracker) AddA ¶
func (t *OverflowTracker) AddA(a MicroNovas, b MicroNovas) MicroNovas
AddA adds 2 MicroNovas values with overflow tracking
func (*OverflowTracker) AddR ¶
func (t *OverflowTracker) AddR(a Round, b Round) Round
AddR adds 2 Round values with overflow tracking
func (*OverflowTracker) Mul ¶
func (t *OverflowTracker) Mul(a uint64, b uint64) uint64
Mul multiplies b from a with overflow detection
func (*OverflowTracker) ScalarMulA ¶
func (t *OverflowTracker) ScalarMulA(a MicroNovas, b uint64) MicroNovas
ScalarMulA multiplies an Algo amount by a scalar
func (*OverflowTracker) Sub ¶
func (t *OverflowTracker) Sub(a uint64, b uint64) uint64
Sub subtracts b from a with overflow detection
func (*OverflowTracker) SubA ¶
func (t *OverflowTracker) SubA(a MicroNovas, b MicroNovas) MicroNovas
SubA subtracts b from a with overflow tracking
type Participant ¶
type Participant struct { // PK is the identifier used to verify the signature for a specific participant // PK는 특정 참여자의 서명을 증명하기 위한 식별자이다. PK merklesignature.Verifier `codec:"p"` // Weight is AccountData.MicroNovas. // Weight는 보유한 알고양이다. Weight uint64 `codec:"w"` // contains filtered or unexported fields }
A Participant corresponds to an account whose AccountData.Status is Online, and for which the expected sigRound satisfies AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.
In the Algorand ledger, it is possible for multiple accounts to have the same PK. Thus, the PK is not necessarily unique among Participants. However, each account will produce a unique Participant struct, to avoid potential DoS attacks where one account claims to have the same VoteID PK as another account.
Participant는 AccountData.Status가 온라인 이고(즉, 합의에 참여가능) sigRound값이 합의에 참여 가능한 라운드 안에 있는 계정과 동일하다. 알고랜드 원장에서는 여러 계정이 동일한 pk를 갖는것이 가능하다(왜지??). 따라서 Participants간에 PK는 반드시 유니크지는 않다. 하지만 각 계정은 유니크한 Participant 구조체를 생성한다. 왜냐하면 하나의 계정이 다른 계정과 동일한 VoteID PK를 갖겠다고 요구하는 DoS공격을 방지하기 위해서다.
func (*Participant) CanMarshalMsg ¶
func (_ *Participant) CanMarshalMsg(z interface{}) bool
func (*Participant) CanUnmarshalMsg ¶
func (_ *Participant) CanUnmarshalMsg(z interface{}) bool
func (*Participant) MarshalMsg ¶
func (z *Participant) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*Participant) MsgIsZero ¶
func (z *Participant) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*Participant) Msgsize ¶
func (z *Participant) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Participant) ToBeHashed ¶
func (p Participant) ToBeHashed() (protocol.HashID, []byte)
ToBeHashed implements the crypto.Hashable interface. In order to create a more SNARK-friendly commitments on the signature we must avoid using the msgpack infrastructure. msgpack creates a compressed representation of the struct which might be varied in length, which will be bad for creating SNARK
서명 생성 시 더욱 SNARK friendly한 약속을 생성하기 위해선 msgpack의 사용을 피해야 한다. msgpack은 압축된 값을 생성하기 때문에 SNARK를 생성하기 위한 길이와 다를 수 있다.
해당 Participant의 압축 서명을 생성한다.
func (*Participant) UnmarshalMsg ¶
func (z *Participant) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type ParticipantsArray ¶
type ParticipantsArray []Participant
ParticipantsArray implements merklearray.Array and is used to commit to a Merkle tree of online accounts.
ParticipantsArray는 머클배열을 구현한다. 배열은 온라인 계정의 머클트리를 커밋하기 위해 사용된다.
func (ParticipantsArray) Length ¶
func (p ParticipantsArray) Length() uint64
Length returns the ledger of the array.
type Round ¶
type Round uint64
Round represents a protocol round index
프로토콜 라운드 인덱스
func (Round) CanMarshalMsg ¶
func (*Round) CanUnmarshalMsg ¶
func (Round) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Round) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Round) RoundUpToMultipleOf ¶
RoundUpToMultipleOf rounds up round to the next multiple of n.
func (Round) SubSaturate ¶
SubSaturate subtracts x rounds with saturation arithmetic that does not wrap around past zero, and instead returns 0 on underflow.
type RoundInterval ¶
type RoundInterval uint64
RoundInterval is a number of rounds
라운드의 수
func (RoundInterval) CanMarshalMsg ¶
func (_ RoundInterval) CanMarshalMsg(z interface{}) bool
func (*RoundInterval) CanUnmarshalMsg ¶
func (_ *RoundInterval) CanUnmarshalMsg(z interface{}) bool
func (RoundInterval) MarshalMsg ¶
func (z RoundInterval) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (RoundInterval) MsgIsZero ¶
func (z RoundInterval) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (RoundInterval) Msgsize ¶
func (z RoundInterval) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*RoundInterval) UnmarshalMsg ¶
func (z *RoundInterval) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type SortAddress ¶
type SortAddress []Address
SortAddress implements sorting by Address keys for canonical encoding of maps in msgpack format.
func (SortAddress) Len ¶
func (a SortAddress) Len() int
func (SortAddress) Less ¶
func (a SortAddress) Less(i, j int) bool
func (SortAddress) Swap ¶
func (a SortAddress) Swap(i, j int)
type SortAppIndex ¶
type SortAppIndex []AppIndex
SortAppIndex implements sorting by AppIndex keys for canonical encoding of maps in msgpack format.
func (SortAppIndex) Len ¶
func (a SortAppIndex) Len() int
func (SortAppIndex) Less ¶
func (a SortAppIndex) Less(i, j int) bool
func (SortAppIndex) Swap ¶
func (a SortAppIndex) Swap(i, j int)
type SortAssetIndex ¶
type SortAssetIndex []AssetIndex
SortAssetIndex implements sorting by AssetIndex keys for canonical encoding of maps in msgpack format.
SortAssetIndex msgpack 형태의 맵들의 표준 인코딩에 대한 AssetIndex key들의 정렬을 구현함.
func (SortAssetIndex) Len ¶
func (a SortAssetIndex) Len() int
func (SortAssetIndex) Less ¶
func (a SortAssetIndex) Less(i, j int) bool
func (SortAssetIndex) Swap ¶
func (a SortAssetIndex) Swap(i, j int)
type SortString ¶
type SortString []string
SortString implements sorting by string keys for canonical encoding of maps in msgpack format.
func (SortString) Len ¶
func (a SortString) Len() int
func (SortString) Less ¶
func (a SortString) Less(i, j int) bool
func (SortString) Swap ¶
func (a SortString) Swap(i, j int)
type SortUint64 ¶
type SortUint64 []uint64
SortUint64 implements sorting by uint64 keys for canonical encoding of maps in msgpack format.
SortUint64는 msgpack 형태의 map들의 표준 인코딩에 대한 uint64 key들의 정렬을 구현함.
func (SortUint64) Len ¶
func (a SortUint64) Len() int
func (SortUint64) Less ¶
func (a SortUint64) Less(i, j int) bool
func (SortUint64) Swap ¶
func (a SortUint64) Swap(i, j int)
type StateDelta ¶
type StateDelta map[string]ValueDelta
StateDelta is a map from key/value store keys to ValueDeltas, indicating what should happen for that key
func (StateDelta) CanMarshalMsg ¶
func (_ StateDelta) CanMarshalMsg(z interface{}) bool
func (*StateDelta) CanUnmarshalMsg ¶
func (_ *StateDelta) CanUnmarshalMsg(z interface{}) bool
func (StateDelta) Equal ¶
func (sd StateDelta) Equal(o StateDelta) bool
Equal checks whether two StateDeltas are equal. We don't check for nilness equality because an empty map will encode/decode as nil. So if our generated map is empty but not nil, we want to equal a decoded nil off the wire.
func (StateDelta) MarshalMsg ¶
func (z StateDelta) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (StateDelta) MsgIsZero ¶
func (z StateDelta) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (StateDelta) Msgsize ¶
func (z StateDelta) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateDelta) UnmarshalMsg ¶
func (z *StateDelta) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
func (StateDelta) Valid ¶
func (sd StateDelta) Valid(proto *config.ConsensusParams) error
Valid checks whether the keys and values in a StateDelta conform to the consensus parameters' maximum lengths
type StateSchema ¶
type StateSchema struct { NumUint uint64 `codec:"nui"` NumByteSlice uint64 `codec:"nbs"` // contains filtered or unexported fields }
StateSchema sets maximums on the number of each type that may be stored
StateSchema는 저장할 수 있는 최대량이다.
func (StateSchema) AddSchema ¶
func (sm StateSchema) AddSchema(osm StateSchema) (out StateSchema)
AddSchema adds two StateSchemas together
func (*StateSchema) CanMarshalMsg ¶
func (_ *StateSchema) CanMarshalMsg(z interface{}) bool
func (*StateSchema) CanUnmarshalMsg ¶
func (_ *StateSchema) CanUnmarshalMsg(z interface{}) bool
func (*StateSchema) MarshalMsg ¶
func (z *StateSchema) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (StateSchema) MinBalance ¶
func (sm StateSchema) MinBalance(proto *config.ConsensusParams) (res MicroNovas)
MinBalance computes the MinBalance requirements for a StateSchema based on the consensus parameters
func (*StateSchema) MsgIsZero ¶
func (z *StateSchema) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*StateSchema) Msgsize ¶
func (z *StateSchema) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (StateSchema) NumEntries ¶
func (sm StateSchema) NumEntries() (tot uint64)
NumEntries counts the total number of values that may be stored for particular schema
func (StateSchema) SubSchema ¶
func (sm StateSchema) SubSchema(osm StateSchema) (out StateSchema)
SubSchema subtracts one StateSchema from another
func (*StateSchema) UnmarshalMsg ¶
func (z *StateSchema) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type StateSchemas ¶
type StateSchemas struct { LocalStateSchema StateSchema `codec:"lsch"` GlobalStateSchema StateSchema `codec:"gsch"` // contains filtered or unexported fields }
StateSchemas is a thin wrapper around the LocalStateSchema and the GlobalStateSchema, since they are often needed together
func (*StateSchemas) CanMarshalMsg ¶
func (_ *StateSchemas) CanMarshalMsg(z interface{}) bool
func (*StateSchemas) CanUnmarshalMsg ¶
func (_ *StateSchemas) CanUnmarshalMsg(z interface{}) bool
func (*StateSchemas) MarshalMsg ¶
func (z *StateSchemas) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*StateSchemas) MsgIsZero ¶
func (z *StateSchemas) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*StateSchemas) Msgsize ¶
func (z *StateSchemas) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateSchemas) UnmarshalMsg ¶
func (z *StateSchemas) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Status ¶
type Status byte
Status is the delegation status of an account's MicroNovas Status는 계정 마이크로 알고의 위임 상태를 나타낸다.
func UnmarshalStatus ¶
UnmarshalStatus decodes string status value back to Status constant
func (Status) CanMarshalMsg ¶
func (*Status) CanUnmarshalMsg ¶
func (Status) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type SupplyDetail ¶
type SupplyDetail struct { Round Round TotalMoney MicroNovas OnlineMoney MicroNovas }
SupplyDetail encapsulates meaningful details about the ledger's current token supply
type TealKeyValue ¶
TealKeyValue represents a key/value store for use in an application's LocalState or GlobalState
func (TealKeyValue) CanMarshalMsg ¶
func (_ TealKeyValue) CanMarshalMsg(z interface{}) bool
func (*TealKeyValue) CanUnmarshalMsg ¶
func (_ *TealKeyValue) CanUnmarshalMsg(z interface{}) bool
func (TealKeyValue) Clone ¶
func (tk TealKeyValue) Clone() TealKeyValue
Clone returns a copy of a TealKeyValue that may be modified without affecting the original
func (TealKeyValue) MarshalMsg ¶
func (z TealKeyValue) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (TealKeyValue) MsgIsZero ¶
func (z TealKeyValue) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (TealKeyValue) Msgsize ¶
func (z TealKeyValue) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (TealKeyValue) ToStateSchema ¶
func (tk TealKeyValue) ToStateSchema() (schema StateSchema, err error)
ToStateSchema calculates the number of each value type in a TealKeyValue and represents the result as a StateSchema
func (*TealKeyValue) UnmarshalMsg ¶
func (z *TealKeyValue) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type TealType ¶
type TealType uint64
TealType is an enum of the types in a TEAL program: Bytes and Uint TEAL 프로그램의 타입: 1이면 byte, 2이면 uint
func (TealType) CanMarshalMsg ¶
func (*TealType) CanUnmarshalMsg ¶
func (TealType) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type TealValue ¶
type TealValue struct { Type TealType `codec:"tt"` Bytes string `codec:"tb"` Uint uint64 `codec:"ui"` // contains filtered or unexported fields }
TealValue contains type information and a value, representing a value in a TEAL program
func (*TealValue) CanMarshalMsg ¶
func (*TealValue) CanUnmarshalMsg ¶
func (*TealValue) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*TealValue) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*TealValue) ToValueDelta ¶
func (tv *TealValue) ToValueDelta() (vd ValueDelta)
ToValueDelta creates ValueDelta from TealValue
type ValueDelta ¶
type ValueDelta struct { // 특정 key가 취할 행동의 종류를 저장하는 변수 Action DeltaAction `codec:"at"` // TealValue에서 사용할 바이트값 Bytes string `codec:"bs"` // TealValue에서 사용할 유닛값 Uint uint64 `codec:"ui"` // contains filtered or unexported fields }
ValueDelta links a DeltaAction with a value to be set
ValueDelta는 한 DeltaAction과 세팅될 값을 연결하는 구조체
func (*ValueDelta) CanMarshalMsg ¶
func (_ *ValueDelta) CanMarshalMsg(z interface{}) bool
func (*ValueDelta) CanUnmarshalMsg ¶
func (_ *ValueDelta) CanUnmarshalMsg(z interface{}) bool
func (*ValueDelta) MarshalMsg ¶
func (z *ValueDelta) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*ValueDelta) MsgIsZero ¶
func (z *ValueDelta) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*ValueDelta) Msgsize ¶
func (z *ValueDelta) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ValueDelta) ToTealValue ¶
func (vd *ValueDelta) ToTealValue() (value TealValue, ok bool)
ToTealValue converts a ValueDelta into a TealValue if possible, and returns ok = false if the conversion is not possible.
func (*ValueDelta) UnmarshalMsg ¶
func (z *ValueDelta) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler