Documentation ¶
Index ¶
- Constants
- func AddNewLeaf(statedb dbm.KV, localdb dbm.KV, info *TreeUpdateInfo, ethAddress string, ...) ([]*types.KeyValue, []*types.KeyValue, error)
- func CalLeafProof(statedb dbm.KV, leaf *zt.Leaf, info *TreeUpdateInfo) (*zt.MerkleTreeProof, error)
- func CalTokenProof(statedb dbm.KV, leaf *zt.Leaf, token *zt.TokenBalance, info *TreeUpdateInfo) (*zt.MerkleTreeProof, error)
- func GetAccountIdPrimaryKey(accountId uint64) []byte
- func GetAccountTreeKey() []byte
- func GetAllRoots(db dbm.KV, endIndex uint64, info *TreeUpdateInfo) ([]*zt.RootInfo, error)
- func GetChain33EthPrimaryKey(chain33Addr string, ethAddr string) []byte
- func GetLeafByAccountId(db dbm.KV, accountId uint64, info *TreeUpdateInfo) (*zt.Leaf, error)
- func GetLeafByChain33Address(db dbm.KV, chain33Addr string) ([]*zt.Leaf, error)
- func GetLeafByChain33AndEthAddress(db dbm.KV, chain33Addr, ethAddress string, info *TreeUpdateInfo) (*zt.Leaf, error)
- func GetLeafByEthAddress(db dbm.KV, ethAddress string) ([]*zt.Leaf, error)
- func GetLeavesByStartAndEndIndex(db dbm.KV, startIndex uint64, endIndex uint64, info *TreeUpdateInfo) ([]*zt.Leaf, error)
- func GetLocalChain33EthPrimaryKey(chain33Addr string, ethAddr string) []byte
- func GetName() string
- func GetRootByStartIndex(db dbm.KV, index uint64, info *TreeUpdateInfo) (*zt.RootInfo, error)
- func GetRootIndexPrimaryKey(rootIndex uint64) []byte
- func GetTokenByAccountIdAndTokenId(db dbm.KV, accountId uint64, tokenId uint64, info *TreeUpdateInfo) (*zt.TokenBalance, error)
- func GetTokenByAccountIdAndTokenIdInDB(db dbm.KV, accountId uint64, tokenId uint64) (*zt.TokenBalance, error)
- func GetTokenPrimaryKey(accountId uint64, tokenId uint64) []byte
- func Init(name string, cfg *types.Chain33Config, sub []byte)
- func InitExecType()
- func NewAccountTree(localdb dbm.KV) ([]*types.KeyValue, []*types.KeyValue)
- func NewAccountTreeTable(kvdb db.KV) *table.Table
- func NewCommitProofTable(kvdb db.KV) *table.Table
- func NewHistoryAccountTreeTable(kvdb db.KV) *table.Table
- func NewZksync() drivers.Driver
- func NewZksyncInfoTable(kvdb db.KV) *table.Table
- func UpdateLeaf(statedb dbm.KV, localdb dbm.KV, info *TreeUpdateInfo, accountId uint64, ...) ([]*types.KeyValue, []*types.KeyValue, error)
- func UpdatePubKey(statedb dbm.KV, localdb dbm.KV, info *TreeUpdateInfo, pubKey *zt.ZkPubKey, ...) ([]*types.KeyValue, []*types.KeyValue, error)
- type AccountTreeRow
- type Action
- func (a *Action) ContractToTree(payload *zt.ZkContractToTree) (*types.Receipt, error)
- func (a *Action) Deposit(payload *zt.ZkDeposit) (*types.Receipt, error)
- func (a *Action) ForceExit(payload *zt.ZkForceExit) (*types.Receipt, error)
- func (a *Action) FullExit(payload *zt.ZkFullExit) (*types.Receipt, error)
- func (a *Action) GetIndex() int64
- func (a *Action) MakeFeeLog(amount string, info *TreeUpdateInfo, tokenId uint64, sign *zt.ZkSignature) (*types.Receipt, error)
- func (a *Action) SetPubKey(payload *zt.ZkSetPubKey) (*types.Receipt, error)
- func (a *Action) Transfer(payload *zt.ZkTransfer) (*types.Receipt, error)
- func (a *Action) TransferToNew(payload *zt.ZkTransferToNew) (*types.Receipt, error)
- func (a *Action) TreeToContract(payload *zt.ZkTreeToContract) (*types.Receipt, error)
- func (a *Action) UpdateContractAccount(addr string, amount string, tokenId uint64, option int32) ([]*types.KeyValue, error)
- func (a *Action) Withdraw(payload *zt.ZkWithdraw) (*types.Receipt, error)
- type CommitProofRow
- type HistoryAccountTreeRow
- type TreeUpdateInfo
- type ZksyncInfoRow
Constants ¶
View Source
const ( //KeyPrefixStateDB state db key必须前缀 KeyPrefixStateDB = "mavl-zksync-" //KeyPrefixLocalDB local db的key必须前缀 KeyPrefixLocalDB = "LODB-zksync" )
Variables ¶
This section is empty.
Functions ¶
func AddNewLeaf ¶
func CalLeafProof ¶
func CalLeafProof(statedb dbm.KV, leaf *zt.Leaf, info *TreeUpdateInfo) (*zt.MerkleTreeProof, error)
func CalTokenProof ¶
func CalTokenProof(statedb dbm.KV, leaf *zt.Leaf, token *zt.TokenBalance, info *TreeUpdateInfo) (*zt.MerkleTreeProof, error)
func GetAccountIdPrimaryKey ¶
func GetAccountTreeKey ¶
func GetAccountTreeKey() []byte
func GetAllRoots ¶
func GetChain33EthPrimaryKey ¶
func GetLeafByAccountId ¶
func GetLeafByChain33Address ¶
func GetLeafByEthAddress ¶
func GetRootByStartIndex ¶
func GetRootIndexPrimaryKey ¶
func GetTokenByAccountIdAndTokenId ¶
func GetTokenByAccountIdAndTokenId(db dbm.KV, accountId uint64, tokenId uint64, info *TreeUpdateInfo) (*zt.TokenBalance, error)
func GetTokenPrimaryKey ¶
func NewAccountTree ¶
NewAccountTree 生成账户树,同时生成1号账户
func NewAccountTreeTable ¶
NewAccountTreeTable ...
func NewCommitProofTable ¶
NewCommitProofTable ...
func NewHistoryAccountTreeTable ¶
NewHistoryAccountTreeTable ...
Types ¶
type AccountTreeRow ¶
AccountTreeRow table meta 结构
func NewAccountTreeRow ¶
func NewAccountTreeRow() *AccountTreeRow
func (*AccountTreeRow) Get ¶
func (r *AccountTreeRow) Get(key string) ([]byte, error)
Get 按照indexName 查询 indexValue
func (*AccountTreeRow) SetPayload ¶
func (r *AccountTreeRow) SetPayload(data types.Message) error
SetPayload 设置数据
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action action struct
func (*Action) ContractToTree ¶
func (*Action) MakeFeeLog ¶
func (a *Action) MakeFeeLog(amount string, info *TreeUpdateInfo, tokenId uint64, sign *zt.ZkSignature) (*types.Receipt, error)
func (*Action) TransferToNew ¶
func (*Action) TreeToContract ¶
func (*Action) UpdateContractAccount ¶
type CommitProofRow ¶
type CommitProofRow struct {
*zt.ZkCommitProof
}
CommitProofRow table meta 结构
func NewCommitProofRow ¶
func NewCommitProofRow() *CommitProofRow
func (*CommitProofRow) Get ¶
func (r *CommitProofRow) Get(key string) ([]byte, error)
Get 按照indexName 查询 indexValue
func (*CommitProofRow) SetPayload ¶
func (r *CommitProofRow) SetPayload(data types.Message) error
SetPayload 设置数据
type HistoryAccountTreeRow ¶
type HistoryAccountTreeRow struct {
*zt.HistoryLeaf
}
HistoryAccountTreeRow table meta 结构
func NewHistoryAccountTreeRow ¶
func NewHistoryAccountTreeRow() *HistoryAccountTreeRow
func (*HistoryAccountTreeRow) CreateRow ¶
func (r *HistoryAccountTreeRow) CreateRow() *table.Row
CreateRow 新建数据行
func (*HistoryAccountTreeRow) Get ¶
func (r *HistoryAccountTreeRow) Get(key string) ([]byte, error)
Get 按照indexName 查询 indexValue
func (*HistoryAccountTreeRow) SetPayload ¶
func (r *HistoryAccountTreeRow) SetPayload(data types.Message) error
SetPayload 设置数据
type TreeUpdateInfo ¶
type TreeUpdateInfo struct {
// contains filtered or unexported fields
}
TreeUpdateInfo 更新信息,用于查询
type ZksyncInfoRow ¶
type ZksyncInfoRow struct {
*zt.OperationInfo
}
AccountTreeRow table meta 结构
func NewZksyncInfoRow ¶
func NewZksyncInfoRow() *ZksyncInfoRow
func (*ZksyncInfoRow) Get ¶
func (r *ZksyncInfoRow) Get(key string) ([]byte, error)
Get 按照indexName 查询 indexValue
func (*ZksyncInfoRow) SetPayload ¶
func (r *ZksyncInfoRow) SetPayload(data types.Message) error
SetPayload 设置数据
Click to show internal directories.
Click to hide internal directories.