Voltar
+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), andexecutable(boolean) - Return an object representing an account with these properties
- The object should also include a
publicKey(generate a new one) andrentEpoch(set to 0 for this mock)
Casos de Teste
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 resultlamports should match the provided value
Entrada:
owner, 500000, data, falseEsperado: typeof result.lamports === 'number' && result.lamports === 500000