@@ -8,24 +8,24 @@ import (
8
8
9
9
// _deploy primes contract's storage with some data to be used later.
10
10
func _deploy (_ interface {}, _ bool ) {
11
- ctx := storage .GetContext ()
11
+ ctx := storage .GetContext () // RW context.
12
12
storage .Put (ctx , "foo1" , "1" )
13
13
storage .Put (ctx , "foo2" , "2" )
14
14
storage .Put (ctx , "foo3" , "3" )
15
15
}
16
16
17
- // NotifyKeysAndValues sends notification with `foo` storage keys and values
17
+ // NotifyKeysAndValues sends notification with `foo` storage keys and values.
18
18
func NotifyKeysAndValues () bool {
19
- iter := storage .Find (storage .GetContext (), []byte ("foo" ), storage .None )
19
+ iter := storage .Find (storage .GetReadOnlyContext (), []byte ("foo" ), storage .None )
20
20
for iterator .Next (iter ) {
21
- runtime .Notify ("found storage key-value pair " , iterator .Value (iter ))
21
+ runtime .Notify ("Key-Value " , iterator .Value (iter ))
22
22
}
23
23
return true
24
24
}
25
25
26
26
// NotifyValues sends notification with `foo` storage values.
27
27
func NotifyValues () bool {
28
- iter := storage .Find (storage .GetContext (), []byte ("foo" ), storage .ValuesOnly )
28
+ iter := storage .Find (storage .GetReadOnlyContext (), []byte ("foo" ), storage .ValuesOnly )
29
29
for iterator .Next (iter ) {
30
30
runtime .Notify ("Value" , iterator .Value (iter ))
31
31
}
0 commit comments