{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.1.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\nPackage util is a generated protocol buffer package.\n\nIt is generated from these files:\n\n\tdah.proto\n\nIt has these top-level messages:\n\n\tTX\n\n## Functions\n\n```go\nfunc ReadVarInt(buffer *bytes.Buffer) uint64\n```\nReadVarInt reads an int that is formatted in the Bitcoin style variable int format\n\n## Types\n\n```go\ntype ExecResult struct {\n\tSumCurrentOutputs uint64\n\tSumPriorOutputs   uint64\n\tIsCoinbase        bool\n}\n```\nExecResult is the result of processing a transaction\n\n```go\ntype InMemoryStore struct {\n\tMap     map[Key]*TX_TXOUT\n\tTranMap map[string][]byte\n}\n```\nInMemoryStore used for unit testing\n\n```go\nfunc (ims *InMemoryStore) DelState(key Key) error\n```\nDelState deletes the given key and corresponding transactions\n\n```go\nfunc (ims *InMemoryStore) GetState(key Key) (*TX_TXOUT, bool, error)\n```\nGetState returns the transaction for the given key\n\n```go\nfunc (ims *InMemoryStore) GetTran(key string) ([]byte, bool, error)\n```\nGetTran returns the transaction for the given hash\n\n```go\nfunc (ims *InMemoryStore) PutState(key Key, value *TX_TXOUT) error\n```\nPutState saves the key and transaction in memory\n\n```go\nfunc (ims *InMemoryStore) PutTran(key string, value []byte) error\n```\nPutTran saves the hash and transaction in memory\n\n```go\ntype Key struct {\n\tTxHashAsHex string\n\tTxIndex     uint32\n}\n```\nKey represents the key for a transaction in storage. It has both a hash and index\n\n```go\ntype Store interface {\n\tGetState(Key) (*TX_TXOUT, bool, error)\n\tPutState(Key, *TX_TXOUT) error\n\tDelState(Key) error\n\tGetTran(string) ([]byte, bool, error)\n\tPutTran(string, []byte) error\n}\n```\nStore interface describes the storage used by this chaincode. The interface was created so either the state database store can be used or a in memory store can be used for unit testing.\n\n```go\nfunc MakeInMemoryStore() Store\n```\nMakeInMemoryStore creates a new in memory store\n\n```go\ntype TX struct {\n\tVersion  uint32      `protobuf:\"varint,1,opt,name=version\" json:\"version,omitempty\"`\n\tLockTime uint32      `protobuf:\"varint,2,opt,name=lockTime\" json:\"lockTime,omitempty\"`\n\tTxin     []*TX_TXIN  `protobuf:\"bytes,3,rep,name=txin\" json:\"txin,omitempty\"`\n\tTxout    []*TX_TXOUT `protobuf:\"bytes,4,rep,name=txout\" json:\"txout,omitempty\"`\n\tBlocks   [][]byte    `protobuf:\"bytes,5,rep,name=blocks,proto3\" json:\"blocks,omitempty\"`\n\tFee      uint64      `protobuf:\"varint,6,opt,name=fee\" json:\"fee,omitempty\"`\n}\n```\n\n```go\nfunc ParseUTXOBytes(txAsUTXOBytes []byte) *TX\n```\nParseUTXOBytes parses a bitcoin style transaction\n\n```go\nfunc (*TX) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TX) GetBlocks() [][]byte\n```\n\n```go\nfunc (m *TX) GetFee() uint64\n```\n\n```go\nfunc (m *TX) GetLockTime() uint32\n```\n\n```go\nfunc (m *TX) GetTxin() []*TX_TXIN\n```\n\n```go\nfunc (m *TX) GetTxout() []*TX_TXOUT\n```\n\n```go\nfunc (m *TX) GetVersion() uint32\n```\n\n```go\nfunc (*TX) ProtoMessage()\n```\n\n```go\nfunc (m *TX) Reset()\n```\n\n```go\nfunc (m *TX) String() string\n```\n\n```go\ntype TX_TXIN struct {\n\tIx         uint32 `protobuf:\"varint,1,opt,name=ix\" json:\"ix,omitempty\"`\n\tSourceHash []byte `protobuf:\"bytes,2,opt,name=sourceHash,proto3\" json:\"sourceHash,omitempty\"`\n\tScript     []byte `protobuf:\"bytes,3,opt,name=script,proto3\" json:\"script,omitempty\"`\n\tSequence   uint32 `protobuf:\"varint,4,opt,name=sequence\" json:\"sequence,omitempty\"`\n}\n```\n\n```go\nfunc (*TX_TXIN) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TX_TXIN) GetIx() uint32\n```\n\n```go\nfunc (m *TX_TXIN) GetScript() []byte\n```\n\n```go\nfunc (m *TX_TXIN) GetSequence() uint32\n```\n\n```go\nfunc (m *TX_TXIN) GetSourceHash() []byte\n```\n\n```go\nfunc (*TX_TXIN) ProtoMessage()\n```\n\n```go\nfunc (m *TX_TXIN) Reset()\n```\n\n```go\nfunc (m *TX_TXIN) String() string\n```\n\n```go\ntype TX_TXOUT struct {\n\tValue    uint64 `protobuf:\"varint,1,opt,name=value\" json:\"value,omitempty\"`\n\tScript   []byte `protobuf:\"bytes,2,opt,name=script,proto3\" json:\"script,omitempty\"`\n\tColor    []byte `protobuf:\"bytes,3,opt,name=color,proto3\" json:\"color,omitempty\"`\n\tQuantity uint64 `protobuf:\"varint,4,opt,name=quantity\" json:\"quantity,omitempty\"`\n}\n```\n\n```go\nfunc (*TX_TXOUT) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TX_TXOUT) GetColor() []byte\n```\n\n```go\nfunc (m *TX_TXOUT) GetQuantity() uint64\n```\n\n```go\nfunc (m *TX_TXOUT) GetScript() []byte\n```\n\n```go\nfunc (m *TX_TXOUT) GetValue() uint64\n```\n\n```go\nfunc (*TX_TXOUT) ProtoMessage()\n```\n\n```go\nfunc (m *TX_TXOUT) Reset()\n```\n\n```go\nfunc (m *TX_TXOUT) String() string\n```\n\n```go\ntype UTXO struct {\n\tStore Store\n}\n```\nUTXO includes the storage for the chaincode API or an in memory store for testing\n\n```go\nfunc MakeUTXO(store Store) *UTXO\n```\nMakeUTXO constructs a new UTXO with the given store\n\n```go\nfunc (u *UTXO) Execute(txData []byte) (*ExecResult, error)\n```\nExecute processes the given transaction and outputs a result\n\n```go\nfunc (u *UTXO) GetTransactionHash(txData []byte) [32]byte\n```\nGetTransactionHash returns the Bitcoin hash (double sha256) of the given transaction\n\n```go\nfunc (u *UTXO) IsCoinbase(index uint32) bool\n```\nIsCoinbase returns true if this is a coinbase transaction, false otherwise\n\n```go\nfunc (u *UTXO) Query(txHashHex string) pb.Response\n```\nQuery search the storage for a given transaction hash\n\n","path":"github.com/eric-erki/https-hyperledger.org/examples/chaincode/go/utxo/util","name":"util","synopsis":"Package util is a generated protocol buffer package.","isRedistributable":true}
