Wrapping Test plan

 

fio.oracle

general

  • RAM tests

  • Fee tests

regoracle

  • Register 3 oracles

    • Observe

      • Successful registration

  • regoracle

    • Attempt to register non-existent account as oracle

      • Observe

        • Error 400:"Invalid oracle"

    • Attempt to register oracle using a single top 21 BP account

      • Observe

        • Error 403:Type: invalid_signature

unregoracle

  • Unregister 3 oracles

    • Observe

      • Successful unregistration

  • unregoracle

    • Attempt to unregister account which is not an oracle

      • Observe

        • Error 400:"Invalid oracle"

    • Attempt to unregister oracle using a single top 21 BP account

      • Observe

        • Error 403:Type: invalid_signature

setoraclefee

  • Each Oracle submits fees as follows:

    • Oracle 1

      • wrap_fio_domain: 2000000000

      • wrap_fio_tokens: 2000000000

    • Oracle 2

      • wrap_fio_domain: 3000000000

      • wrap_fio_tokens: 5000000000

    • Oracle 3

      • wrap_fio_domain: 5000000000

      • wrap_fio_tokens: 9000000000

    • Observe

      • No errors

      • RAM of signer is increased

    • Validate

      • Run /get_oracle_fees

      • Observe:

        • "wrap_fio_domain": 9000000000

        • "wrap_fio_tokens": 15000000000

  • Error testing

    • Send invalid wrap_fio_domain

      • Observe

        • Error 400:"Invalid wrap_fio_domain value"

    • Send invalid wrap_fio_tokens

      • Observe

        • Error 400:"Invalid wrap_fio_tokens value"

    • Attempt setoraclefee while not an Oracle

      • Observe

        • Error 400:"Not a registered Oracle"

wraptokens

  • Wrap 100 FIO tokens

    • Observe:

      • Tokens transferred to fio.wrapping

      • FIO Chain fee charged

      • Oracle fees transferred to Oracles

      • RAM of signer is increased

  • Error testing

    • Send invalid amount

      • Observe

        • Error 400:"Invalid amount"

    • Send invalid max_oracle_fee

      • Observe

        • Error 400:"Invalid oracle fee value"

    • Send max_oracle_fee less than Oracle fee

      • Observe

        • Error 400:"Oracle fee exceeds supplied maximum"

    • Send invalid max_fee

      • Observe

        • Error 400:"Invalid fee value"

    • Send max_fee less than fee

      • Observe

        • Error 400:"Fee exceeds supplied maximum"

    • Attempt to wrap with insufficient balance to cover amount + oracle fee + chain fee

      • Observe

        • Error 400:"Insufficient balance"

    • Send invalid tpid

      • Observe

        • Error 400:"TPID must be empty or valid FIO address"

unwraptokens

  • Unwrap 100 FIO tokens

    • 3 Oracles execute

    • Observe after Oracle 1 and 2

      • Tokens not transferred

      • RAM of signer is increased

    • Observe after Oracle 3

      • Tokens transferred to designated address

      • RAM of signer is increased

  • Error Testing

    • Send invalid amount

      • Observe

        • Error 400:"Invalid amount"

    • Send invalid fio_address

      • Observe

        • Error 400:"Invalid FIO Address"

    • Attempt to unwrap amount less than balance

      • Observe

        • Error 400:"Insufficient balance"

    • Attempt unwraptokens while not an Oracle

      • Observe

        • Error 400:"Not a registered Oracle"

fio.erc20

general

  • Verify 10 preloaded custodian

regcust

  • Register 7 custodians

    • Observe

      • Successful registration

  • Attempt to register non-existant account as custodian

    • Observe

      • Error 400: “Invalid address”

unregcust

  • Unregister a custodian

    • Observe

      • Successful unregistration

  • Register an oracle with unregistered custodian

    • Observe

      • Error 400: “Invalid address”

regoracle

  • Register 3 oracles

    • Observe

      • Successful registration

  • Attempt to register non-existent account as oracle

    • Observe

      • Error 400:"Invalid oracle"

  • Attempt to register oracle using an account that is not a custdian

    • Observe

      • Error 400: “Invalid custodian”

unregoracle

  • Unregister 3 oracles

    • Observe

      • Successful unregistration

  • Attempt to unregister account which is not an oracle

    • Observe

      • Error 400:"Invalid oracle"

  • Attempt to unregister oracle from account that is not a custodian

    • Observe

      • Error 400: “Invalid custodian”

unwrap

  • unwrap 100 wFIO

    • Observe:

      • Tokens transferred to fio.wrapping

  • Unwrap invalid amount

    • Observe

      • Error 400:"Invalid amount"

  • Attempt to wrap with insufficient balance to cover amount

    • Observe

      • Error 400:"Insufficient balance"

wrap

  • Wrap 100 FIO tokens

    • 3 Oracles execute

    • Observe after Oracle 1 and 2

      • wFIO Tokens not transferred

    • Observe after Oracle 3

      • wFIO tokens transferred to designated address

  • Send invalid amount

    • Observe

      • Error 400:"Invalid amount"

  • Send invalid ETH address

    • Observe

      • Error 400:"Invalid Address"

  • Attempt wraptokens while not an Oracle

    • Observe

      • Error 400:"Not a registered Oracle"