9
9
"github.com/lightningnetwork/lnd/fn"
10
10
"github.com/lightningnetwork/lnd/lnrpc"
11
11
"github.com/lightningnetwork/lnd/lntypes"
12
- "github.com/lightningnetwork/lnd/lnwire"
13
12
"github.com/stretchr/testify/require"
14
13
)
15
14
@@ -122,15 +121,15 @@ func TestAccountUpdateMethods(t *testing.T) {
122
121
// Ensure that the function errors out if we try update an
123
122
// account that does not exist.
124
123
err := store .UpdateAccountBalanceAndExpiry (
125
- ctx , AccountID {}, fn .None [lnwire. MilliSatoshi ](),
124
+ ctx , AccountID {}, fn .None [int64 ](),
126
125
fn .None [time.Time ](),
127
126
)
128
127
require .ErrorIs (t , err , ErrAccNotFound )
129
128
130
129
acct , err := store .NewAccount (ctx , 0 , time.Time {}, "foo" )
131
130
require .NoError (t , err )
132
131
133
- assertBalanceAndExpiry := func (balance lnwire. MilliSatoshi ,
132
+ assertBalanceAndExpiry := func (balance int64 ,
134
133
expiry time.Time ) {
135
134
136
135
dbAcct , err := store .Account (ctx , acct .ID )
@@ -146,7 +145,7 @@ func TestAccountUpdateMethods(t *testing.T) {
146
145
assertBalanceAndExpiry (0 , time.Time {})
147
146
148
147
// Now, update just the balance of the account.
149
- newBalance := lnwire . MilliSatoshi (123 )
148
+ newBalance := int64 (123 )
150
149
err = store .UpdateAccountBalanceAndExpiry (
151
150
ctx , acct .ID , fn .Some (newBalance ), fn .None [time.Time ](),
152
151
)
@@ -156,8 +155,7 @@ func TestAccountUpdateMethods(t *testing.T) {
156
155
// Now update just the expiry of the account.
157
156
newExpiry := clock .Now ().Add (time .Hour )
158
157
err = store .UpdateAccountBalanceAndExpiry (
159
- ctx , acct .ID , fn .None [lnwire.MilliSatoshi ](),
160
- fn .Some (newExpiry ),
158
+ ctx , acct .ID , fn .None [int64 ](), fn .Some (newExpiry ),
161
159
)
162
160
require .NoError (t , err )
163
161
assertBalanceAndExpiry (newBalance , newExpiry )
@@ -174,8 +172,7 @@ func TestAccountUpdateMethods(t *testing.T) {
174
172
// Finally, test an update that has no net changes to the
175
173
// balance or expiry.
176
174
err = store .UpdateAccountBalanceAndExpiry (
177
- ctx , acct .ID , fn .None [lnwire.MilliSatoshi ](),
178
- fn .None [time.Time ](),
175
+ ctx , acct .ID , fn .None [int64 ](), fn .None [time.Time ](),
179
176
)
180
177
require .NoError (t , err )
181
178
assertBalanceAndExpiry (newBalance , newExpiry )
0 commit comments