Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plutusdao-plsarb-staking-balance] plutusdao-plsarb-staking-balance #1395

Closed

Conversation

0x-logic
Copy link
Contributor

New strategy: plutusdao-plsarb-staking-balance

PlutusDAO hosts asset staking vaults. This strategy uses the userInfo function to get a user's staked balance within a vault.

❯ yarn test --strategy=plutusdao-plsarb-staking-balance
(node:22910) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
  console.log
    [
      {
        '0x8425176e0b0E1d2CB0220a7EB7702F215440eDf3': 754.3186434576993,
        '0x989c4FB381b38fd031862F96a8519ac438552EA3': 693.3779435596775,
        '0x8D3a67337c180D66448C314816036723047B38f8': 21311.914621942182,
        '0x86fF945E6DC2470317ca082A01dE7D24188671Ac': 1021.7019367246185,
        '0x01e09581B0DEE63Bcc16e8DC823cb93DBD5E6F29': 2136.48665844
      }
    ]

      at Object.<anonymous> (test/strategy.test.ts:77:15)

  console.log
    Resolved in 0.37 sec.

      at Object.<anonymous> (test/strategy.test.ts:78:15)

  console.log
    Scores with latest snapshot [
      {
        '0x8425176e0b0E1d2CB0220a7EB7702F215440eDf3': 754.3186434576993,
        '0x989c4FB381b38fd031862F96a8519ac438552EA3': 693.3779435596775,
        '0x8D3a67337c180D66448C314816036723047B38f8': 21311.914621942182,
        '0x86fF945E6DC2470317ca082A01dE7D24188671Ac': 1021.7019367246185,
        '0x01e09581B0DEE63Bcc16e8DC823cb93DBD5E6F29': 2136.48665844
      }
    ]

      at Object.<anonymous> (test/strategy.test.ts:163:15)

  console.log
    Resolved in 0.31 sec.

      at Object.<anonymous> (test/strategy.test.ts:164:15)

 PASS  test/strategy.test.ts (5.271 s)

Test strategy "plutusdao-plsarb-staking-balance" with example index 0
    ✓ Strategy name should be lowercase and should not contain any special char expect hyphen (1 ms)
    ✓ Strategy name should be same as in examples.json
    ✓ Addresses in example should be minimum 3 and maximum 20 (1 ms)
    ✓ Must use a snapshot block number in the past (483 ms)
    ✓ Strategy should run without any errors (390 ms)
    ✓ Should return an array of object with addresses (1 ms)
    ✓ Should take less than 10 sec. to resolve
    ✓ File examples.json should include at least 1 address with a positive score
    ✓ Returned addresses should be checksum addresses (1 ms)
    ✓ Voting power should not depend on other addresses (436 ms)

Test strategy "plutusdao-plsarb-staking-balance" with example index 0 (latest snapshot)
    ✓ Strategy should run without any errors (821 ms)
    ✓ Should return an array of object with addresses (1 ms)

Test strategy "plutusdao-plsarb-staking-balance" with example index 0 (with 500 addresses)
    ○ skipped Should work with 500 addresses
    ○ skipped Should take less than 20 sec. to resolve with 500 addresses

Other tests with example index 0
    ✓ Check schema (if available) is valid with examples.json (48 ms)
    ✓ Check schema (if available) all arrays in all levels should contain `items` property
    ✓ Strategy should work even when strategy symbol is null

Others:
    ✓ Author in strategy should be a valid github username (233 ms)
    ✓ Version in strategy should be a valid string

Test Suites: 1 passed, 1 total
Tests:       2 skipped, 17 passed, 19 total
Snapshots:   0 total
Time:        5.341 s
Ran all test suites matching /strategy.test.ts/i.

@ChaituVR ChaituVR changed the title [strategy] plutusdao-plsarb-staking-balance [plutusdao-plsarb-staking-balance] plutusdao-plsarb-staking-balance Jan 25, 2024
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @0x-logic I think you can use contract-call strategy here in your space directly. no need to create a seperate strategy

@0x-logic
Copy link
Contributor Author

@ChaituVR oh, you're right. I think that will work. Thanks!

@0x-logic 0x-logic closed this Jan 25, 2024
@0x-logic 0x-logic deleted the plutusdao-plsarb-staking-balance branch January 25, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants