MCPcopy Index your code
hub / github.com/yeasy/blockchain_guide / newAddress

Function newAddress

11_app_dev/chaincode_example05.go:254–257  ·  view source on GitHub ↗
(ctx contractapi.TransactionContextInterface, prefix string)

Source from the content-addressed store, hash-verified

252}
253
254func newAddress(ctx contractapi.TransactionContextInterface, prefix string) string {
255 sum := sha256.Sum256([]byte(prefix + ":" + ctx.GetStub().GetTxID()))
256 return hex.EncodeToString(sum[:])
257}
258
259func txUnixTime(ctx contractapi.TransactionContextInterface) (int64, error) {
260 timestamp, err := ctx.GetStub().GetTxTimestamp()

Callers 1

CreateUserMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected