Documentation ¶
Index ¶
- Constants
- func DecodeProto(arg []byte, m proto.Message) error
- func DefaultNetworkName() string
- func EncodeProto(m proto.Message) []byte
- func GenerateNonce() []byte
- func GetAddrCheckSum(rb []byte) ([AddressVerifyCodeSize]byte, error)
- func GetHashOfRawTx(header []byte, msg []byte, method string) []byte
- func NewTxBuilder(ccname string, nonce []byte, method string, msg proto.Message) (*baseBuilder, error)
- func NewTxBuilder2(ccname string, nonce []byte) (b *baseBuilder, err error)
- func NewTxBuilderWithTimeLock(ccname string, nonce []byte, t time.Time) (b *baseBuilder, err error)
- func NewTxMaker(args [][]byte) *baseMaker
- func NormalizeHash(h []byte) []byte
- func SetAddressInterfaceImpl(impl AddressInterface)
- func UseNetwork(i uint8)
- type AddrCredentialBuilder
- type AddrCredentials
- type Address
- func NewAddress(pub abcrypto.Verifier) (*Address, error)
- func NewAddressFromHash(h []byte) *Address
- func NewAddressFromPBMessage(addrProto *pb.TxAddr) (*Address, error)
- func NewAddressFromPrivateKey(priv abcrypto.Signer) (*Address, error)
- func NewAddressFromString(addressStr string) (*Address, error)
- type AddressHelper
- type AddressInterface
- type AddressInterfaceV1
- type Builder
- type DataCredentials
- type DataCredentialsBuilder
- type Flags
- type Parser
- type TxArgParser
- type TxMaker
Constants ¶
View Source
const ( ADDRESS_VERSION = 1 ADDRESS_CRC_LEN = 4 ADDRESS_HASH_LEN = 20 )
View Source
const ( AddressRequirePartByteSize = ADDRESS_HASH_LEN + ADDRESS_VERSION AddressVerifyCodeSize = ADDRESS_CRC_LEN )
Variables ¶
This section is empty.
Functions ¶
func GetAddrCheckSum ¶
func GetAddrCheckSum(rb []byte) ([AddressVerifyCodeSize]byte, error)
func NewTxBuilder ¶
func NewTxBuilderWithTimeLock ¶
func SetAddressInterfaceImpl ¶
func SetAddressInterfaceImpl(impl AddressInterface)
SetAddressInterfaceImpl set impl nil to restore v1
Types ¶
type AddrCredentialBuilder ¶
type AddrCredentials ¶
type AddrCredentials interface { Verify(addr Address) error CredCount() int // GetCredPubkey(addr Address) *crypto.PublicKey // ListCredPubkeys() []*crypto.PublicKey GetCredPubkey(addr Address) crypto.Verifier ListCredPubkeys() []crypto.Verifier }
func NewAddrCredential ¶
func NewAddrCredential(hash []byte, addrc []*pb.TxCredential_AddrCredentials_User) (ret AddrCredentials, e error)
type AddressHelper ¶
var AddrHelper AddressHelper = map[uint8]string{
1: "ABCHAIN",
4: "VCTMAINNET",
}
type AddressInterface ¶
type AddressInterface interface { NewAddressFromString(addressStr string) (*Address, error) Serialize(addr *Address) []byte }
AddressInterface interface
type AddressInterfaceV1 ¶
type AddressInterfaceV1 struct{}
AddressInterfaceV1 struct
func (AddressInterfaceV1) NewAddressFromString ¶
func (m AddressInterfaceV1) NewAddressFromString(addressStr string) (*Address, error)
NewAddressFromString for AddressInterfaceV1
func (AddressInterfaceV1) Serialize ¶
func (m AddressInterfaceV1) Serialize(addr *Address) []byte
Serialize for AddressInterfaceV1
type DataCredentialsBuilder ¶
type Flags ¶
type Flags uint32
Flags for txoption
type Parser ¶
type Parser interface { GetCCname() string GetNonce() []byte GetFlags() Flags GetTxTime() time.Time GetAddrCredential() AddrCredentials GetDataCredential() DataCredentials //an optional index can passed to fetch a message pushed in stack //no argument or 0 fetch the current message GetMessage(...int) proto.Message PushMsg(proto.Message) PopMsg() proto.Message //is alias of PushMsg now (backward compatibility) UpdateMsg(proto.Message) }
Parser ...
type TxArgParser ¶
a parser which can handle the arguments of a transaction with purposed format in hyperledger project
type TxMaker ¶
type TxMaker interface { GetCredBuilder() AddrCredentialBuilder GetDataCredBuilder() DataCredentialsBuilder GenArguments() ([][]byte, error) GenArgumentsWithoutCred() ([][]byte, error) GenHash(string) []byte }
Click to show internal directories.
Click to hide internal directories.