GetHash() returns the cryptographic hash of the Transaction
()
| 132 | |
| 133 | // GetHash() returns the cryptographic hash of the Transaction |
| 134 | func (x *Transaction) GetHash() ([]byte, ErrorI) { |
| 135 | // convert the transaction into proto bytes |
| 136 | protoBytes, err := Marshal(x) |
| 137 | // if an error occurred during the conversion |
| 138 | if err != nil { |
| 139 | // exit with error |
| 140 | return nil, err |
| 141 | } |
| 142 | // exit with the hash of the proto bytes |
| 143 | return crypto.Hash(protoBytes), nil |
| 144 | } |
| 145 | |
| 146 | // GetSig() accessor for signature field (do not delete: needed to satisfy TransactionI) |
| 147 | func (x *Transaction) GetSig() SignatureI { return x.Signature } |