(t *testing.T)
| 276 | } |
| 277 | |
| 278 | func TestTransferToken(t *testing.T) { |
| 279 | Convey("test TransferToken to a address", t, func() { |
| 280 | var stopTestService func() |
| 281 | var err error |
| 282 | var user proto.AccountAddress |
| 283 | |
| 284 | // driver not initialized |
| 285 | _, err = TransferToken(user, 100, types.Particle) |
| 286 | So(err, ShouldEqual, ErrNotInitialized) |
| 287 | |
| 288 | // fake driver initialized |
| 289 | atomic.StoreUint32(&driverInitialized, 1) |
| 290 | _, err = TransferToken(user, 100, types.Particle) |
| 291 | So(err, ShouldNotBeNil) |
| 292 | // reset driver not initialized |
| 293 | atomic.StoreUint32(&driverInitialized, 0) |
| 294 | |
| 295 | stopTestService, _, err = startTestService() |
| 296 | So(err, ShouldBeNil) |
| 297 | defer stopTestService() |
| 298 | |
| 299 | // with mock bp, any params will be success |
| 300 | txHash, err := TransferToken(user, 100, types.Particle) |
| 301 | So(err, ShouldBeNil) |
| 302 | |
| 303 | ctx := context.Background() |
| 304 | _, err = WaitTxConfirmation(ctx, txHash) |
| 305 | So(err, ShouldBeNil) |
| 306 | }) |
| 307 | } |
| 308 | |
| 309 | func TestUpdatePermission(t *testing.T) { |
| 310 | Convey("test UpdatePermission to a address", t, func() { |
nothing calls this directly
no test coverage detected