Documentation ¶
Overview ¶
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2021 Zilliqa * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func ByteArrayToUint(src []byte, offset uint, numericTypeLen uint) *big.Int
- func GenerateStorageKey(addr, vname string, indices []string) []byte
- func IP2Long(ip string) uint32
- func SkipIfCI(t *testing.T)
- func UintToByteArray(dst []byte, offset uint, num *big.Int, numericTypeLen uint) []byte
- type AccountBase
- type BIGNumSerialize
- type BalanceAndNonce
- type BitVector
- type BlockBase
- type BlockHeaderBase
- type BlockList
- type BlockchainInfo
- type CoSignatures
- type ContractValue
- type DSBlock
- type DSBlockHashSet
- type DSComm
- type DsBlock
- type DsBlockHeader
- type DsBlockHeaderT
- type DsBlockT
- type DsHeader
- type ECPointSerialize
- type EventLog
- type GovernanceElementT
- type HashAndNum
- type IPAndPort
- type MicroBlockInfo
- type MinerInfo
- type MinerInfoDSComm
- type Pair
- type PairOfNode
- type ParamConstructor
- type Peer
- type PendingStatus
- type PendingTxnResult
- type PendingTxns
- type SWInfo
- type SWInfoT
- type SerializedT
- type ShardInfo
- type ShardingStructure
- type Signature
- type State
- type StateProof
- type Transaction
- type TransactionException
- type TransactionMessage
- type TransactionReceipt
- type TransactionStatus
- type TransactionStatusId
- type Transactions
- type Transition
- type TxBlock
- type TxBlockBodyT
- type TxBlockHashSet
- type TxBlockHeader
- type TxBlockHeaderT
- type TxBlockOrDsBlock
- type TxBlockT
- type VoteT
Constants ¶
const ScillaIndexSeparator = 0x16
Variables ¶
var PendingTxnError = map[int]string{
0: "Txn was already processed and confirmed",
1: "Pending - nonce too high",
2: "Pending - blk gas limit exceeded",
3: "Pending - consensus failure",
4: "Error - txn not found",
10: "Dropped - math error",
11: "Dropped - scilla invocation error",
12: "Dropped - account init error",
13: "Dropped - invalid source account",
14: "Dropped - gas limit too high",
15: "Dropped - txn type unknown",
16: "Dropped - txn in wrong shard",
17: "Dropped - account in wrong shard",
18: "Dropped - code size too large",
19: "Dropped - txn verification error",
20: "Dropped - gas limit too low",
21: "Dropped - insuff balance",
22: "Dropped - insuff gas for checker",
23: "Dropped - duplicate txn found",
24: "Dropped - txn w/ higher gas found",
25: "Dropped - invalid dest account",
26: "Dropped - state addition error",
}
Functions ¶
func ByteArrayToUint ¶
extract a number from the source byte stream at the specific offset. Uint128 -> 16 (bytes) Uint64 -> 8 (bytes) Uint32 -> 4 (bytes)
func GenerateStorageKey ¶
func UintToByteArray ¶
place a number into the destination byte stream at the specified offset caller should make sure that the value of numericTypeLen following rules Uint128 -> 16 (bytes) Uint64 -> 8 (bytes) Uint32 -> 4 (bytes)
Types ¶
type AccountBase ¶
type AccountBase struct { Version uint32 Balance uint64 Nonce uint64 StorageRoot []byte CodeHash []byte }
func AccountBaseFromBytes ¶
func AccountBaseFromBytes(bytes []byte) (*AccountBase, error)
type BIGNumSerialize ¶
type BIGNumSerialize struct{}
type BalanceAndNonce ¶
type BitVector ¶
type BitVector struct{}
func (*BitVector) GetBitVectorLengthInBytes ¶
func (*BitVector) GetBitVectorSerializedSize ¶
type BlockBase ¶
type BlockBase struct { BlockHash [32]byte Cosigs CoSignatures Timestamp uint64 }
func (*BlockBase) ToProtobuf ¶
func (b *BlockBase) ToProtobuf() *protobuf.ProtoBlockBase
type BlockHeaderBase ¶
type BlockHeaderBase struct { Version uint32 // Hash for the committee that generated the block CommitteeHash [32]byte PrevHash [32]byte }
func (*BlockHeaderBase) ToProtobuf ¶
func (b *BlockHeaderBase) ToProtobuf() *protobuf.ProtoBlockHeaderBase
type BlockList ¶
type BlockList struct { Data []HashAndNum `json:"data"` MaxPages int `json:"maxPages"` }
type BlockchainInfo ¶
type ContractValue ¶
type DSBlockHashSet ¶
type DsBlock ¶
type DsBlock struct { BlockBase BlockHeader *DsBlockHeader PrevDSHash string }
func NewDsBlockFromDsBlockT ¶
func (*DsBlock) ToProtobuf ¶
type DsBlockHeader ¶
type DsBlockHeader struct { BlockHeaderBase BlockHeaderBase DsDifficulty uint32 Difficulty uint32 // The one who proposed this DS block // base16 string LeaderPubKey string // Block index, starting from 0 in the genesis block BlockNum uint64 // Tx Epoch Num then the DS block was generated EpochNum uint64 GasPrice string SwInfo SWInfo PowDSWinnersList []string // key is (base16) public key PoWDSWinners map[string]Peer // (base16) public key RemoveDSNodePubKeys []string // todo concrete data type DSBlockHashSet DSBlockHashSet ProposalIds []uint32 GovDSShardVotesMap map[uint32]Pair }
func NewDsBlockHeaderFromDsBlockT ¶
func NewDsBlockHeaderFromDsBlockT(dst *DsBlockT) *DsBlockHeader
func (*DsBlockHeader) Serialize ¶
func (d *DsBlockHeader) Serialize() []byte
func (*DsBlockHeader) ToProtobuf ¶
func (d *DsBlockHeader) ToProtobuf(concreteVarsOnly bool) *protobuf.ProtoDSBlock_DSBlockHeader
the default value of concreteVarsOnly should be false
type DsBlockHeaderT ¶
type DsBlockHeaderT struct { BlockNum string CommitteeHash string Difficulty uint32 DifficultyDS uint32 EpochNum string GasPrice string LeaderPubKey string MembersEjected []string PoWWinners []string PoWWinnersIP []IPAndPort PrevHash string ReservedField string SWInfo *SWInfoT ShardingHash string Governance []GovernanceElementT Timestamp string Version uint32 }
type DsBlockT ¶
type DsBlockT struct { B1 []bool `json:"B1"` B2 []bool `json:"B2"` CS1 string `json:"CS1"` PrevDSHash string `json:"PrevDSHash"` Header DsBlockHeaderT `json:"header"` Serialized SerializedT `json:"serialized"` Signatures string `json:"signature"` }
ds block transfer struct (via rpc)
type ECPointSerialize ¶
type ECPointSerialize struct {
BIGNumSerialize
}
type EventLog ¶
type EventLog struct { EventName string `json:"_eventname"` Address string `json:"address"` Params []ContractValue `json:"params"` }
type GovernanceElementT ¶
type HashAndNum ¶
type MicroBlockInfo ¶
type MinerInfoDSComm ¶
type PairOfNode ¶
type ParamConstructor ¶
type ParamConstructor struct { Constructor string `json:"constructor"` ArgTypes []interface{} `json:"argtypes"` Arguments []interface{} `json:"arguments"` }
type Peer ¶
type PendingStatus ¶
type PendingTxnResult ¶
type PendingTxns ¶
type PendingTxns struct {
Txns []*PendingStatus
}
type SWInfo ¶
type SerializedT ¶
type ShardingStructure ¶
type ShardingStructure struct {
NumPeers []int
}
type Signature ¶
func NewFromByteArray ¶
type StateProof ¶
type Transaction ¶
type TransactionException ¶
type TransactionMessage ¶
type TransactionMessage struct { Amount string `json:"_amount"` Recipient string `json:"_recipient"` Tag string `json:"_tag"` Params []ContractValue `json:"params"` }
type TransactionReceipt ¶
type TransactionReceipt struct { Accept bool `json:"accept"` Errors interface{} `json:"errors"` Exceptions []TransactionException `json:"exceptions"` Success bool `json:"success"` CumulativeGas string `json:"cumulative_gas"` EpochNum string `json:"epoch_num"` EventLogs []EventLog `json:"event_logs"` Transitions []Transition `json:"transitions"` }
type TransactionStatus ¶
type TransactionStatus struct { ID string Amount string `json:"amount"` Data string `json:"data"` EpochInserted string `json:"epochInserted"` EpochUpdated string `json:"epochUpdated"` GasLimit string `json:"gasLimit"` GasPrice string `json:"gasPrice"` LastModified string `json:"lastModified"` ModificationState int `json:"modificationState"` Nonce string `json:"nonce"` SenderAddr string `json:"senderAddr"` Signature string `json:"signature"` Status int `json:"status"` Success bool `json:"success"` ToAddr string `json:"toAddr"` Version string `json:"version"` // contains filtered or unexported fields }
type TransactionStatusId ¶
type TransactionStatusId struct {
// contains filtered or unexported fields
}
type Transactions ¶
type Transactions struct {
TxnHashes []string
}
type Transition ¶
type Transition struct { Accept bool `json:"accept"` Addr string `json:"addr"` Depth int `json:"depth"` Msg TransactionMessage `json:"msg"` }
type TxBlock ¶
type TxBlock struct { BlockBase BlockHeader *TxBlockHeader }
func NewTxBlockFromTxBlockT ¶
type TxBlockBodyT ¶
type TxBlockHashSet ¶
type TxBlockHeader ¶
type TxBlockHeader struct { BlockHeaderBase BlockHeaderBase GasLimit uint64 GasUsed uint64 // uint128 Rewards *big.Int // block index, starting from 0 in the genesis block BlockNum uint64 HashSet TxBlockHashSet NumTxs uint32 // Leader of the committee who proposed this block // base16 string MinerPubKey string // DS Block index at the time this Tx block was proposed DSBlockNum uint64 }
func NewTxBlockHeaderFromTxBlockT ¶
func NewTxBlockHeaderFromTxBlockT(txt *TxBlockT) *TxBlockHeader
func (*TxBlockHeader) Serialize ¶
func (t *TxBlockHeader) Serialize() []byte
func (*TxBlockHeader) ToProtoBuf ¶
func (t *TxBlockHeader) ToProtoBuf() *protobuf.ProtoTxBlock_TxBlockHeader
type TxBlockHeaderT ¶
type TxBlockHeaderT struct { BlockNum string CommitteeHash string DSBlockNum string GasLimit string GasUsed string MbInfoHash string MinerPubKey string NumMicroBlocks int NumTxns uint32 PrevBlockHash string Rewards string StateDeltaHash string StateRootHash string Timestamp string TxnFees string Version int }
type TxBlockOrDsBlock ¶
type TxBlockT ¶
type TxBlockT struct { Header TxBlockHeaderT `json:"header"` Body TxBlockBodyT `json:"body"` }