@@ -6,20 +6,28 @@ import (
6
6
"github.com/cosmos/cosmos-sdk/x/accumulator/types"
7
7
)
8
8
9
- func (k BaseKeeper ) DistributeTokens (ctx sdk.Context , fromPool string , isSentToModule bool , amount sdk.Coins , receiverModule string , receiverAddress * sdk. AccAddress ) error {
10
- poolAddress := GetPoolAddress (fromPool )
9
+ func (k BaseKeeper ) DistributeToModule (ctx sdk.Context , pool string , amount sdk.Coins , receiverModule string ) error {
10
+ poolAddress := GetPoolAddress (pool )
11
11
if poolAddress == nil {
12
12
return types .ErrInvalidPool
13
13
}
14
14
15
- if isSentToModule {
16
- return k .sendFromAddressToModule (ctx , poolAddress , receiverModule , amount )
15
+ return k .sendFromAddressToModule (ctx , poolAddress , receiverModule , amount )
16
+
17
+ }
18
+
19
+ func (k BaseKeeper ) DistributeToAccount (ctx sdk.Context , pool string , amount sdk.Coins , receiver sdk.AccAddress ) error {
20
+
21
+ poolAddress := GetPoolAddress (pool )
22
+ if poolAddress == nil {
23
+ return types .ErrInvalidPool
17
24
}
18
25
19
- if receiverAddress == nil {
26
+ if receiver == nil {
20
27
return types .ErrInvalidReceiver
21
28
}
22
- return k .sendFromAddressToAddress (ctx , poolAddress , * receiverAddress , amount )
29
+
30
+ return k .sendFromAddressToAddress (ctx , poolAddress , receiver , amount )
23
31
24
32
}
25
33
@@ -32,7 +40,7 @@ func (k BaseKeeper) sendFromAddressToModule(ctx sdk.Context, poolAddress sdk.Acc
32
40
)
33
41
34
42
if err != nil {
35
- err = errors .Wrap (err , "sending native coins to address " )
43
+ err = errors .Wrap (err , "sending native coins to account " )
36
44
k .Logger (ctx ).Error (err .Error ())
37
45
return err
38
46
}
@@ -62,7 +70,7 @@ func (k BaseKeeper) sendFromAddressToAddress(ctx sdk.Context, poolAddress sdk.Ac
62
70
)
63
71
64
72
if err != nil {
65
- err = errors .Wrap (err , "sending native coins to module " )
73
+ err = errors .Wrap (err , "sending native coins to account " )
66
74
k .Logger (ctx ).Error (err .Error ())
67
75
return err
68
76
}
0 commit comments