@@ -232,8 +232,8 @@ func TestDeposit(t *testing.T) {
232232 balance := new (big.Int ).SetUint64 (42 )
233233 chbook .Deposit (balance )
234234 backend .Commit ()
235- if chbook .balance .Cmp (balance ) != 0 {
236- t .Fatalf ("expected balance %v, got %v" , balance , chbook .balance )
235+ if chbook .Balance () .Cmp (balance ) != 0 {
236+ t .Fatalf ("expected balance %v, got %v" , balance , chbook .Balance () )
237237 }
238238
239239 amount := common .Big1
@@ -243,8 +243,8 @@ func TestDeposit(t *testing.T) {
243243 }
244244 backend .Commit ()
245245 exp := new (big.Int ).SetUint64 (41 )
246- if chbook .balance .Cmp (exp ) != 0 {
247- t .Fatalf ("expected balance %v, got %v" , exp , chbook .balance )
246+ if chbook .Balance () .Cmp (exp ) != 0 {
247+ t .Fatalf ("expected balance %v, got %v" , exp , chbook .Balance () )
248248 }
249249
250250 // autodeposit on each issue
@@ -259,8 +259,8 @@ func TestDeposit(t *testing.T) {
259259 t .Fatalf ("expected no error, got %v" , err )
260260 }
261261 backend .Commit ()
262- if chbook .balance .Cmp (balance ) != 0 {
263- t .Fatalf ("expected balance %v, got %v" , balance , chbook .balance )
262+ if chbook .Balance () .Cmp (balance ) != 0 {
263+ t .Fatalf ("expected balance %v, got %v" , balance , chbook .Balance () )
264264 }
265265
266266 // autodeposit off
@@ -277,11 +277,11 @@ func TestDeposit(t *testing.T) {
277277 backend .Commit ()
278278
279279 exp = new (big.Int ).SetUint64 (40 )
280- if chbook .balance .Cmp (exp ) != 0 {
281- t .Fatalf ("expected balance %v, got %v" , exp , chbook .balance )
280+ if chbook .Balance () .Cmp (exp ) != 0 {
281+ t .Fatalf ("expected balance %v, got %v" , exp , chbook .Balance () )
282282 }
283283
284- // autodeposit every 10ms if new cheque issued
284+ // autodeposit every 30ms if new cheque issued
285285 interval := 30 * time .Millisecond
286286 chbook .AutoDeposit (interval , common .Big1 , balance )
287287 _ , err = chbook .Issue (addr1 , amount )
@@ -296,14 +296,14 @@ func TestDeposit(t *testing.T) {
296296 backend .Commit ()
297297
298298 exp = new (big.Int ).SetUint64 (38 )
299- if chbook .balance .Cmp (exp ) != 0 {
300- t .Fatalf ("expected balance %v, got %v" , exp , chbook .balance )
299+ if chbook .Balance () .Cmp (exp ) != 0 {
300+ t .Fatalf ("expected balance %v, got %v" , exp , chbook .Balance () )
301301 }
302302
303303 time .Sleep (3 * interval )
304304 backend .Commit ()
305- if chbook .balance .Cmp (balance ) != 0 {
306- t .Fatalf ("expected balance %v, got %v" , balance , chbook .balance )
305+ if chbook .Balance () .Cmp (balance ) != 0 {
306+ t .Fatalf ("expected balance %v, got %v" , balance , chbook .Balance () )
307307 }
308308
309309 exp = new (big.Int ).SetUint64 (40 )
@@ -319,8 +319,8 @@ func TestDeposit(t *testing.T) {
319319 }
320320 time .Sleep (3 * interval )
321321 backend .Commit ()
322- if chbook .balance .Cmp (exp ) != 0 {
323- t .Fatalf ("expected balance %v, got %v" , exp , chbook .balance )
322+ if chbook .Balance () .Cmp (exp ) != 0 {
323+ t .Fatalf ("expected balance %v, got %v" , exp , chbook .Balance () )
324324 }
325325
326326 _ , err = chbook .Issue (addr1 , amount )
@@ -330,8 +330,8 @@ func TestDeposit(t *testing.T) {
330330 time .Sleep (1 * interval )
331331 backend .Commit ()
332332
333- if chbook .balance .Cmp (balance ) != 0 {
334- t .Fatalf ("expected balance %v, got %v" , balance , chbook .balance )
333+ if chbook .Balance () .Cmp (balance ) != 0 {
334+ t .Fatalf ("expected balance %v, got %v" , balance , chbook .Balance () )
335335 }
336336
337337 chbook .AutoDeposit (1 * interval , common .Big0 , balance )
@@ -352,8 +352,8 @@ func TestDeposit(t *testing.T) {
352352 backend .Commit ()
353353
354354 exp = new (big.Int ).SetUint64 (39 )
355- if chbook .balance .Cmp (exp ) != 0 {
356- t .Fatalf ("expected balance %v, got %v" , exp , chbook .balance )
355+ if chbook .Balance () .Cmp (exp ) != 0 {
356+ t .Fatalf ("expected balance %v, got %v" , exp , chbook .Balance () )
357357 }
358358
359359}
0 commit comments