| 
									
										
										
										
											2021-10-13 16:52:52 -07:00
										 |  |  | import { expect } from "chai"; | 
					
						
							| 
									
										
										
										
											2022-03-10 18:58:22 +08:00
										 |  |  | import { solana_program_init, Keypair } from "crate"; | 
					
						
							|  |  |  | solana_program_init(); | 
					
						
							| 
									
										
										
										
											2021-10-13 16:52:52 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | describe("Keypair", function () { | 
					
						
							|  |  |  |   it("works", () => { | 
					
						
							|  |  |  |     const keypair = new Keypair(); | 
					
						
							|  |  |  |     let bytes = keypair.toBytes(); | 
					
						
							|  |  |  |     expect(bytes).to.have.length(64); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const recoveredKeypair = Keypair.fromBytes(bytes); | 
					
						
							|  |  |  |     expect(keypair.pubkey().equals(recoveredKeypair.pubkey())); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |