Versions in this module Expand all Collapse all v3 v3.0.1 Dec 25, 2023 Changes in this version + const NativePrefix + const Violation + func FilterBlacklistTxs(txs []*commonPb.Transaction) []*commonPb.Transaction + func FilterBlockBlacklistEvents(events []*commonPb.ContractEvent, chainId string) []*commonPb.ContractEvent + func FilterBlockBlacklistTxRWSet(txRWSet []*commonPb.TxRWSet, chainId string) (txRWSetNew []*commonPb.TxRWSet) + func FilterBlockBlacklistTxs(block *commonPb.Block) *commonPb.Block v3.0.0 Dec 23, 2022 Changes in this version + const DPosOrgId + const DecBase + const KLV_LENGTH_SIZE + const PrefixContractByteCode + const PrefixContractInfo + const TopicTableColumnDdl + const TopicTableIndex + const TopicTableUniqueKey + var OidKeyBag = asn1.ObjectIdentifier + func AddPrefix(origin string, prefixs []string) string + func BinaryToUint32(in []byte) (uint32, error) + func CalcBlockHash(hashType string, b *commonPb.Block) ([]byte, error) + func CalcDagHash(hashType string, dag *commonPb.DAG) ([]byte, error) + func CalcPartialBlockHash(hashType string, b *commonPb.Block) ([]byte, error) + func CalcRWSetHash(hashType string, set *commonPb.TxRWSet) ([]byte, error) + func CalcRWSetRoot(hashType string, txs []*commonPb.Transaction) ([]byte, error) + func CalcResultBytes(result *commonPb.Result) ([]byte, error) + func CalcTxHash(hashType string, t *commonPb.Transaction) ([]byte, error) + func CalcTxHashWithVersion(hashType string, t *commonPb.Transaction, version int) ([]byte, error) + func CalcTxRequestHash(hashType string, t *commonPb.Transaction) ([]byte, error) + func CalcTxResultHash(hashType string, result *commonPb.Result) ([]byte, error) + func CalcTxVerifyWorkers(txCount int) int + func CalcUnsignedTxBytes(t *commonPb.Transaction) ([]byte, error) + func CalcUnsignedTxRequestBytes(txReq *commonPb.TxRequest) ([]byte, error) + func CanProposeEmptyBlock(consensusType consensusPb.ConsensusType) bool + func CertToAddrInt(cert *x509.Certificate, addrType config.AddrType) (*evmutils.Int, error) + func CertToAddrStr(cert *x509.Certificate, addrType config.AddrType) (string, error) + func CheckChainIdFormat(chainId string) bool + func CheckContractNameFormat(name string) bool + func CheckEvmAddressFormat(addr string) bool + func CheckRootCertificate(certPEM string) (bool, error) + func CheckTxIDFormat(txID string) bool + func CheckZxlAddrFormat(addr string) bool + func ConvertCmTx2EthTx(tx *commonPb.Transaction) (*ethbase.Transaction, error) + func ConvertEthTx2CmTx(tx *ethbase.Transaction) (*commonPb.Transaction, error) + func CreateGenesis(cc *configPb.ChainConfig) (*commonPb.Block, []*commonPb.TxRWSet, error) + func CurrentTimeMillisSeconds() int64 + func CurrentTimeSeconds() int64 + func DispatchTxVerifyTask(txs []*commonPb.Transaction) map[int][]*commonPb.Transaction + func FilterBlockTxs(reqSenderOrgId string, block *commonPb.Block) *commonPb.Block + func FormatBlock(b *commonPb.Block) string + func FormatRWSet(set *commonPb.TxRWSet) string + func GZipCompressBytes(data []byte) ([]byte, error) + func GZipDeCompressBytes(data []byte) ([]byte, error) + func GenerateCreateTopicTableDdl(t *commonPb.ContractEvent, chainId string) string + func GenerateInstallContractPayload(contractName, version string, runtimeType commonPb.RuntimeType, ...) (*commonPb.Payload, error) + func GenerateSaveBlockHeightWithTopicDdl(t *commonPb.ContractEvent, chainId string, blockHeight uint64) string + func GenerateSaveContractEventDdl(t *commonPb.ContractEvent, chainId string, blockHeight uint64, eventIdx int) string + func GenerateUpdateBlockHeightIndexDdl(blockHeight uint64) string + func GetBlockVersion(cfgVersion string) uint32 + func GetCertHash(_ string, userCrtPEM []byte, hashType string) ([]byte, error) + func GetCertificateId(certPEM []byte, hashType string) ([]byte, error) + func GetCertificateIdFromDER(certDER []byte, hashType string) ([]byte, error) + func GetCertificateIdHex(certPEM []byte, hashType string) (string, error) + func GetConsensusArgsFromBlock(block *commonPb.Block) (*consensusPb.BlockHeaderConsensusArgs, error) + func GetContractByName(readObject func(contractName string, key []byte) ([]byte, error), name string) (*commonPb.Contract, error) + func GetContractByteCodeDbKey(contractName string) []byte + func GetContractBytecode(readObject func(contractName string, key []byte) ([]byte, error), name string) ([]byte, error) + func GetContractDbKey(contractName string) []byte + func GetIntAddrFromMember(member protocol.Member, addrType config.AddrType) (*evmutils.Int, error) + func GetIntAddrFromPbMember(pbMember *acPb.Member, addrType config.AddrType, hashType crypto.HashType) (*evmutils.Int, error) + func GetMemberPubKeySA(member *acPb.Member, getter MemberGetter) ([]byte, uint32) + func GetNodeUidFromAddr(addr string) (string, error) + func GetRandTxId() string + func GetRoleFromTx(tx *commonPb.Transaction, ac protocol.AccessControlProvider) (protocol.Role, error) + func GetSqlStatementCount(sql string) int + func GetSqlTableName(sql string) []string + func GetStrAddrFromMember(member protocol.Member, addrType config.AddrType) (string, error) + func GetStrAddrFromPbMember(pbMember *acPb.Member, addrType config.AddrType, hashType crypto.HashType) (string, error) + func GetTimestampTxId() string + func GetTimestampTxIdByNano(nano int64) string + func GetTxIdWithSeed(seed int64) string + func GetTxIds(txs []*commonPb.Transaction) []string + func HasDPosTxWritesInHeader(block *commonPb.Block, chainConf protocol.ChainConf) bool + func IsAllBlank(args ...interface{}) bool + func IsAnyBlank(args ...interface{}) bool + func IsCertManagementTx(tx *commonPb.Transaction) bool + func IsConfBlock(block *commonPb.Block) bool + func IsConfigTx(tx *commonPb.Transaction) bool + func IsContractManagementTx(tx *commonPb.Transaction) bool + func IsContractMgmtBlock(b *commonPb.Block) bool + func IsContractMgmtTx(tx *commonPb.Transaction) bool + func IsDagEqual(dag1 *commonPb.DAG, dag2 *commonPb.DAG) (bool, error) + func IsEmptyBlock(block *commonPb.Block) error + func IsManageContractAsConfigTx(tx *commonPb.Transaction, enableSqlDB bool) bool + func IsManagementTx(tx *commonPb.Transaction) bool + func IsMultiSignManagementTx(tx *commonPb.Transaction) bool + func IsNativeContract(contractName string) bool + func IsNativeTx(tx *commonPb.Transaction) (isNative bool, contractName string) + func IsPubKeyManagementTx(tx *commonPb.Transaction) bool + func IsValidConfigTx(tx *commonPb.Transaction) bool + func MarshalTxBytes(t *commonPb.Transaction) ([]byte, error) + func NameToAddrInt(name string, addrType config.AddrType, blockVersion uint32) (*evmutils.Int, error) + func NameToAddrStr(name string, addrType config.AddrType, blockVersion uint32) (string, error) + func ParseCert(crtPEM []byte) (*bcx509.Certificate, error) + func ParsePkFromPbMember(member *acPb.Member) (crypto.PublicKey, error) + func PkToAddrInt(pk crypto.PublicKey, addrType config.AddrType, hashType crypto.HashType) (*evmutils.Int, error) + func PkToAddrStr(pk crypto.PublicKey, addrType config.AddrType, hashType crypto.HashType) (string, error) + func RearrangeRWSet(block *commonPb.Block, rwSetMap map[string]*commonPb.TxRWSet) []*commonPb.TxRWSet + func SignBlock(hashType string, singer protocol.SigningMember, b *commonPb.Block) ([]byte, []byte, error) + func ToCamelCase(field string) string + func Uint32ToBinary(in uint32) []byte + func UnmarshalEthRlpBytes(data []byte) (*commonPb.Transaction, error) + func UnmarshalJsonStrKV2KVPairs(jsonStr string) ([]*commonpb.KeyValuePair, error) + func UnmarshalTxBytes(data []byte) (*commonPb.Transaction, error) + func UpdateField(params map[string][]byte, key string, config interface{}) (bool, error) + func VerifyBlockSig(hashType string, b *commonPb.Block, ac protocol.AccessControlProvider) (bool, error) + func VerifyCertIssue(caCerts [][]byte, intermediateCerts [][]byte, cert []byte) error + func VerifyDPoSConfig(cc *configPb.ChainConfig) error + func VerifyTxSignature(t *commonPb.Transaction) (bool, error) + func VerifyTxWithoutPayload(tx *commonPb.Transaction, chainId string, ac protocol.AccessControlProvider, ...) error + type BigInteger struct + Value *big.Int + func Div(x, y *BigInteger) *BigInteger + func Mod(x, y *BigInteger) *BigInteger + func Mul(x, y *BigInteger) *BigInteger + func NewBigInteger(value string) *BigInteger + func NewZeroBigInteger() *BigInteger + func Sub(x, y *BigInteger) *BigInteger + func Sum(x, y *BigInteger) *BigInteger + func (x *BigInteger) Add(y *BigInteger) + func (x *BigInteger) Cmp(y *BigInteger) int + func (x *BigInteger) String() string + func (x *BigInteger) Sub(y *BigInteger) + type BlockFingerPrint string + func CalcBlockFingerPrint(block *commonPb.Block) BlockFingerPrint + func CalcBlockFingerPrintWithoutTx(block *commonPb.Block) BlockFingerPrint + func CalcFingerPrint(chainId string, height uint64, timestamp int64, ...) BlockFingerPrint + type DistributionAndSlashingConfig struct + type ERC20Config struct + type MemberGetter interface + GetFullMemberInfo func(memberId []byte, mtype acPb.MemberType) ([]byte, error) + type StakeConfig struct + type TEEProof struct + Certificate *bcx509.Certificate + CertificateDER []byte + Challenge []byte + EncryptionKey bccrypto.EncryptKey + EncryptionKeyPEM []byte + Report []byte + Signature []byte + VerificationKey bccrypto.PublicKey + VerificationKeyPEM []byte + func AttestationVerify(proof []byte, certOpts bcx509.VerifyOptions, reportFromChain []byte) (bool, *TEEProof, error) + func AttestationVerifyComponents(challenge, signature, report []byte, certificate *bcx509.Certificate, ...) (bool, *TEEProof, error) + func GrapheneAttestationVerify(proof *tee.RemoteAttestationResponse, certOpts bcx509.VerifyOptions, ...) (bool, *TEEProof, error) Other modules containing this package chainmaker.org/chainmaker/utils/v2