From ac45220376d23824f1d764877aea3ada90fb0d0f Mon Sep 17 00:00:00 2001 From: Samuel Venzi Date: Wed, 28 Aug 2024 13:47:44 -0300 Subject: [PATCH] Include last transaction ID as asset metadata Signed-off-by: Samuel Venzi --- assets/asset.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/asset.go b/assets/asset.go index 7db83f6..05fbbfe 100644 --- a/assets/asset.go +++ b/assets/asset.go @@ -93,6 +93,9 @@ func (a *Asset) injectMetadata(stub *sw.StubWrapper) errors.ICCError { } (*a)["@lastUpdated"] = lastUpdated.AsTime().Format(time.RFC3339) + lastTxID := stub.Stub.GetTxID() + (*a)["@lastTxID"] = lastTxID + return nil }