본문 바로가기

블록체인/솔라나

[Solana] Error processing Instruction 1: custom program error: 0x1

 

 

솔라나의 anchor에서 테스트하던 도중 Error processing Instruction 1: custom program error: 0x1 에러 발생

 

  Initializer program state:
     Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 1: custom program error: 0x1
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:4594:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:4553:20)
      at sendAndConfirmRawTransaction (node_modules/@project-serum/anchor/src/provider.ts:288:21)
      at AnchorProvider.sendAndConfirm (node_modules/@project-serum/anchor/src/provider.ts:148:14)

 

 

에러 발생 원인

 

지갑의 잔고 부족 때문에 발생한 에러였다.

충분한 테스트용 Sol을 요청하자

const res = await provider.connection.requestAirdrop(
      payer.publicKey,
      LAMPORTS_PER_SOL * 100
    );

await provider.connection.confirmTransaction(res, "confirmed");