Saltar al contenido principal
Superteam Brasil
Atrás
+10 XP
10/12

Challenge: Explore the Account Model

Create a function that builds a mock Solana account structure. This will help you understand the key properties every account has.

Requirements

  • Create a function that accepts owner (PublicKey), lamports (number), data (Uint8Array), and executable (boolean)
  • Return an object representing an account with these properties
  • The object should also include a publicKey (generate a new one) and rentEpoch (set to 0 for this mock)

Casos de Prueba

Should return object with all 6 account fields
Entrada: owner, 1000000, data, trueEsperado: 'publicKey' in result && 'owner' in result && 'lamports' in result && 'data' in result && 'executable' in result && 'rentEpoch' in result
lamports should match the provided value
Entrada: owner, 500000, data, falseEsperado: typeof result.lamports === 'number' && result.lamports === 500000

Discusión