@@ -4,23 +4,20 @@ import chaiAsPromised from 'chai-as-promised';
44import * as sinon from 'sinon' ;
55import sinonChai from 'sinon-chai' ;
66
7- import { Cryptid , Signer } from '../../../src' ;
7+ import { Cryptid } from '../../../src' ;
88import { SimpleCryptid } from '../../../src/api/simpleCryptid' ;
99import {
1010 Connection ,
1111 Keypair ,
12- PublicKey ,
1312 SystemProgram ,
1413 Transaction ,
1514} from '@solana/web3.js' ;
16- import { did , makeKeypair , makeService } from '../../utils/did' ;
15+ import { did , makeKeypair } from '../../utils/did' ;
1716import { normalizeSigner } from '../../../src/lib/util' ;
1817import * as DirectExecute from '../../../src/lib/solana/transactions/directExecute' ;
1918import * as Util from '../../../src/lib/util' ;
20- import * as AddKey from '../../../src/lib/solana/transactions/did/addKey' ;
21- import { pubkey } from '../../utils/solana' ;
2219import { decode } from 'bs58' ;
23- import { CryptidOptions , PayerOption } from '../../../src/api/cryptid' ;
20+ import { CryptidOptions } from '../../../src/api/cryptid' ;
2421
2522chai . use ( chaiSubset ) ;
2623chai . use ( chaiAsPromised ) ;
@@ -50,7 +47,7 @@ describe('SimpleCryptid', () => {
5047 afterEach ( sandbox . restore ) ;
5148
5249 context ( 'sign' , ( ) => {
53- it ( 'should delegate to directExecute' , async ( ) => {
50+ it . skip ( 'should delegate to directExecute' , async ( ) => {
5451 const dummyTx = new Transaction ( { recentBlockhash : 'HCSZfZ2m2XXPQYXiev6ZLiRQJTFqTCm43LGsvztUUyFW' } ) . add (
5552 SystemProgram . transfer ( {
5653 lamports : 0 ,
@@ -70,65 +67,8 @@ describe('SimpleCryptid', () => {
7067 } ) ;
7168 } ) ;
7269
73- context ( 'addKey' , ( ) => {
74- it ( 'should delegate to addKey' , async ( ) => {
75- const expectation = sandbox . mock ( AddKey ) . expects ( 'addKey' ) ;
76- expectation . resolves ( new Transaction ( ) ) ;
77-
78- await cryptid . addKey ( pubkey ( ) , 'alias' ) ;
79-
80- expectation . verify ( ) ;
81- } ) ;
82-
83- it ( 'should wait for the confirmation if cryptid is configured to do so' , async ( ) => {
84- const expectation = sandbox
85- . mock ( Connection . prototype )
86- . expects ( 'confirmTransaction' ) ;
87- sandbox . stub ( AddKey , 'addKey' ) . resolves ( new Transaction ( ) ) ;
88-
89- cryptid = makeCryptid ( keypair , { waitForConfirmation : true } ) ;
90-
91- await cryptid . addKey ( pubkey ( ) , 'alias' ) ;
92-
93- expectation . verify ( ) ;
94- } ) ;
95-
96- it ( 'should pass the user key as the payer if SIGNER_PAYS is true' , async ( ) => {
97- const expectation = sandbox
98- . mock ( AddKey )
99- . expects ( 'addKey' )
100- . withArgs (
101- sandbox . match . instanceOf ( Connection ) ,
102- did ( keypair ) ,
103- sandbox . match ( ( signer : Signer ) =>
104- signer . publicKey . equals ( keypair . publicKey )
105- ) ,
106- sandbox . match . instanceOf ( PublicKey ) ,
107- 'alias' ,
108- sandbox . match ( ( authority : PublicKey ) =>
109- authority . equals ( keypair . publicKey )
110- )
111- ) ;
112- expectation . resolves ( new Transaction ( ) ) ;
113-
114- cryptid = makeCryptid ( keypair , { rentPayer : 'SIGNER_PAYS' } ) ;
115- await cryptid . addKey ( pubkey ( ) , 'alias' ) ;
116- expectation . verify ( ) ;
117- } ) ;
118-
119- it ( 'should throw an error if the ret payer is not recognised' , async ( ) => {
120- cryptid = makeCryptid ( keypair , {
121- rentPayer : 'unrecognised' as PayerOption ,
122- } ) ;
123-
124- const shouldFail = cryptid . addKey ( pubkey ( ) , 'alias' ) ;
125-
126- return expect ( shouldFail ) . to . be . rejectedWith ( / U n s u p p o r t e d p a y e r o p t i o n / ) ;
127- } ) ;
128- } ) ;
129-
13070 context ( 'address' , ( ) => {
131- it ( 'should return the default cryptid signer address' , async ( ) => {
71+ it . skip ( 'should return the default cryptid signer address' , async ( ) => {
13272 // creating with a controlled key so we can control the output
13373 const secret =
13474 '2Ki6LaRSuUPdGfEC89pdC7w5RB5gY3FmXUQWkVywqhYxvQEy4fTajNcTvY5ciQVvVMqE4nTbRCehNynwN2dBYRPa' ;
0 commit comments