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

chore: add tests for reward and power actor state extracters #83

Merged
merged 2 commits into from
Oct 11, 2020

Conversation

iand
Copy link
Contributor

@iand iand commented Oct 9, 2020

Note that this branched from #81

@iand iand requested review from frrist and placer14 October 9, 2020 16:51
@iand iand force-pushed the iand/actorstate-further-tests branch from 5fa4170 to 38b0e38 Compare October 9, 2020 16:52
Copy link
Contributor

@placer14 placer14 left a comment

Choose a reason for hiding this comment

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

Test writing is not glamorous, but I appreciate it! 🤝 🙌

state.TotalPledgeCollateral = abi.NewTokenAmount(0)
state.ThisEpochRawBytePower = abi.NewStoragePower(0)
state.ThisEpochQualityAdjPower = abi.NewStoragePower(0)
state.ThisEpochPledgeCollateral = abi.NewTokenAmount(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Going to add some values here to make sure we don't get false positives due to zero values conveniently matching our test data.

assert.EqualValues(t, info.ParentStateRoot.String(), cr.StateRoot, "StateRoot")
assert.EqualValues(t, state.CumsumBaseline.String(), cr.CumSumBaseline, "CumSumBaseline")
// TODO: assertion fails due to bug in lotus see https://github.com/filecoin-project/lotus/pull/4268
// assert.EqualValues(t, state.CumsumRealized.String(), cr.CumSumRealized, "CumSumRealized")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh... beautiful! Nice find!

@placer14 placer14 force-pushed the iand/actorstate-further-tests branch from 9d05123 to f53a7f7 Compare October 11, 2020 04:50
@placer14
Copy link
Contributor

Rebased onto latest master to make it more obvious what is being changed in this PR.

@placer14 placer14 merged commit 44b41e4 into master Oct 11, 2020
@placer14 placer14 deleted the iand/actorstate-further-tests branch October 11, 2020 05:09
placer14 added a commit that referenced this pull request Oct 14, 2020
* origin/master:
  fix: remove errgrp from UnindexedBlockData persist
  fix: verify there are no missing migrations before migrating (#89)
  chore: add tests for reward and power actor state extracters (#83)
  feat: support v2 actor codes (#84)
  feat(debug): Process actor by head without persistance (#86)
  fix: use debugf logging method in message processor (#82)
  feat(task): Create chainvis views and refresher (#77)
  perf: minor optimization of market actor diffing (#78)
  chore: fail database tests if VISOR_TEST_DB not set (#79)
  test(storage): add test to check for duplicate schema migrations (#80)
  in-process lotus "repo" lens (#75)

 Conflicts:
        tasks/actorstate/miner.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants