@@ -103,6 +103,8 @@ type HostContext interface {
103103 createAddr Address , err error )
104104 AccessAccount (addr Address ) AccessStatus
105105 AccessStorage (addr Address , key Hash ) AccessStatus
106+ GetTransientStorage (addr Address , key Hash ) Hash
107+ SetTransientStorage (addr Address , key Hash , value Hash )
106108}
107109
108110//export accountExists
@@ -247,3 +249,15 @@ func accessStorage(pCtx unsafe.Pointer, pAddr *C.evmc_address, pKey *C.evmc_byte
247249 ctx := getHostContext (uintptr (pCtx ))
248250 return C .enum_evmc_access_status (ctx .AccessStorage (goAddress (* pAddr ), goHash (* pKey )))
249251}
252+
253+ //export getTransientStorage
254+ func getTransientStorage (pCtx unsafe.Pointer , pAddr * C.struct_evmc_address , pKey * C.evmc_bytes32 ) C.evmc_bytes32 {
255+ ctx := getHostContext (uintptr (pCtx ))
256+ return evmcBytes32 (ctx .GetTransientStorage (goAddress (* pAddr ), goHash (* pKey )))
257+ }
258+
259+ //export setTransientStorage
260+ func setTransientStorage (pCtx unsafe.Pointer , pAddr * C.evmc_address , pKey * C.evmc_bytes32 , pVal * C.evmc_bytes32 ) {
261+ ctx := getHostContext (uintptr (pCtx ))
262+ ctx .SetTransientStorage (goAddress (* pAddr ), goHash (* pKey ), goHash (* pVal ))
263+ }
0 commit comments