     expect(result[1].constructor.name).toBe('Promise')
 
   it "prefix pairingId when it save asociated label", ->
-    spyOn(ledger.storage.sync, 'set')
-    @$.setPairingLabel("a_random_pairing_id", "label")
-    expect(ledger.storage.sync.set).toHaveBeenCalledWith("__m2fa_a_random_pairing_id": "label")
+    spyOn(ledger.m2fa.PairedSecureScreen, 'create').and.callThrough()
+    spyOn(ledger.m2fa.PairedSecureScreen.prototype, 'toStore')
+    @$.saveSecureScreen("a_random_pairing_id", "label")
+    expect(ledger.m2fa.PairedSecureScreen.create).toHaveBeenCalledWith("a_random_pairing_id", "label")
+    expect(ledger.m2fa.PairedSecureScreen.prototype.toStore).toHaveBeenCalled()
 
   it "remove pairingId prefix when it get all pairing labels", ->
     spyOn(ledger.storage.sync, 'keys').and.callFake (cb) -> cb(["__m2fa_a_random_pairing_id", 'onOtherBadKey'])

    tx =
      _out: {authorizationPaired: "XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx"}
    pairingId = "a_random_pairing_id"
    client = jasmine.createSpyObj('client',['on','off','sendChallenge','rejectPairing','confirmPairing','requestValidation'])
    spyOn(@$, '_getClientFor').and.returnValue(client)
    
    [c, r] = @$.validateTx(tx, pairingId)

    expect(r.constructor.name).toBe('Promise')

    expect(@$._getClientFor).toHaveBeenCalledWith(pairingId)
    expect(client.off.calls.count()).toBe(2)

  it "get call validateTx for each client on validateTxOnAll", ->
    tx =
      _out: {authorizationPaired: "XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx"}
    spyOn(@$, 'getPairingIds').and.returnValue(Q([{"a_random_pairing_id":"label"}]))
    spyOn(@$, 'validateTx').and.returnValue(Q())
    console.log(typeof ledger.api.M2faRestClient.instance)
    spyOn(ledger.api.M2faRestClient.instance, 'wakeUpSecureScreens')
    [c, r] = @$.validateTxOnAll(tx)
    expect(ledger.api.M2faRestClient.instance.wakeUpSecureScreens).toHaveBeenCalledWith(["a_random_pairing_id"])
    expect(@$.validateTx.calls.count()).toBe(1)
    expect(@$.validateTx.calls.argsFor(0)).toEqual([tx,"a_random_pairing_id"])

