Skip to content

Commit e95858d

Browse files
committed
chore: Add checksum of tx to TransactionInfo
1 parent fa57376 commit e95858d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib_libwasmvm_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ func TestEnv(t *testing.T) {
253253
expected, _ := json.Marshal(env)
254254
require.Equal(t, expected, ires.Data)
255255

256+
tx_hash, _ := types.ForceNewChecksum("AABBCCDDEEFF0011AABBCCDDEEFF0011AABBCCDDEEFF0011AABBCCDDEEFF0011").MarshalJSON()
257+
256258
// Execute mirror env with Transaction
257259
env = types.Env{
258260
Block: types.BlockInfo{
@@ -264,7 +266,8 @@ func TestEnv(t *testing.T) {
264266
Address: "wasm10dyr9899g6t0pelew4nvf4j5c3jcgv0r5d3a5l",
265267
},
266268
Transaction: &types.TransactionInfo{
267-
Index: 18,
269+
Index: 18,
270+
TransactionHash: tx_hash,
268271
},
269272
}
270273
info = api.MockInfo("creator", nil)

types/env.go

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ type TransactionInfo struct {
3333
// Along with BlockInfo.Height, this allows you to get a unique
3434
// transaction identifier for the chain for future queries
3535
Index uint32 `json:"index"`
36+
37+
// Checksum of the transaction.
38+
TransactionHash []byte `json:"transaction_hash,omitempty"`
3639
}
3740

3841
type MessageInfo struct {

0 commit comments

Comments
 (0)