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

refactor(sdk): update tests #895

Merged
merged 1 commit into from
Jan 19, 2025
Merged

refactor(sdk): update tests #895

merged 1 commit into from
Jan 19, 2025

Conversation

alexfreska
Copy link
Member

@alexfreska alexfreska commented Jan 18, 2025

Copy link

vercel bot commented Jan 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 1:18am
explorer-zen ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 1:18am
hostd ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 1:18am
renterd ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 1:18am
website ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2025 1:18am

Copy link

changeset-bot bot commented Jan 18, 2025

⚠️ No Changeset found

Latest commit: afada87

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member Author

alexfreska commented Jan 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

libs/sdk/src/rhp.spec.ts Outdated Show resolved Hide resolved
Copy link
Member Author

@alexfreska alexfreska left a comment

Choose a reason for hiding this comment

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

@n8maninger synced up the tests to work with the changes, two bits I couldn't figure out / or may require changes outside web:

  1. 2 tests are returning the account as a byte array.
    -     "account": "1b6793e900df020dc9a43c6df5f5d10dc5793956d44831ca5bbfec659021b75e",
    +     "account": Array [
    +       27,
    +       103,
    +       147,
    +       233,
    +       0,
    +       223,
    +       2,
    +       13,
    +       201,
    +       164,
    +       60,
    +       109,
    +       245,
    +       245,
    +       209,
    +       13,
    +       197,
    +       121,
    +       57,
    +       86,
    +       212,
    +       72,
    +       49,
    +       202,
    +       91,
    +       191,
    +       236,
    +       101,
    +       144,
    +       33,
    +       183,
    +       94,
    +     ],
  1. getting the following error on the spendpolicy test:
  ● wallet › addressFromSpendPolicy › valid

    expect(received).toBeUndefined()

    Received: "json: cannot unmarshal string into Go value of type struct { Type string \"json:\\\"type\\\"\"; Policy json.RawMessage \"json:\\\"policy\\\"\" }"

      120 |         'thresh(1, [above(100),pk(0x5e4bbc181bae781575a30fabdce472842d0373c12eafcd8013dba0cbf69e34e0)])'
      121 |       const { error, address } = sdk.wallet.addressFromSpendPolicy(spendPolicy)
    > 122 |       expect(error).toBeUndefined()
          |                     ^
      123 |       expect(address).toEqual(
      124 |         '170bf8f730c072a881edf9be3c08d0491f23810f7344125444ebff4bd8855d98dd9159fe1cea'
      125 |       )

@alexfreska alexfreska requested a review from n8maninger January 18, 2025 19:55
@alexfreska alexfreska force-pushed the refactor_sdk_update_tests branch from 417cbe3 to beef293 Compare January 18, 2025 20:02
@n8maninger
Copy link
Member

'thresh(1, [above(100),pk(0x5e4bbc181bae781575a30fabdce472842d0373c12eafcd8013dba0cbf69e34e0)])'

We don't use this format any more. It's just JSON now. Should be easier to build and consume:

{
  "type": "thresh",
  "policy": {
    "n": 1,
    "of": [
      {
        "type": "above",
        "policy": 100
      },
      {
        "type": "pk",
        "policy": "ed25519:5e4bbc181bae781575a30fabdce472842d0373c12eafcd8013dba0cbf69e34e0"
      }
    ]
  }
}

@n8maninger
Copy link
Member

If you update core to 0.9.1, the account tests should be back to strings

@alexfreska alexfreska force-pushed the refactor_sdk_update_tests branch from a02ec96 to 4a47b74 Compare January 18, 2025 20:18
@alexfreska
Copy link
Member Author

If you update core to 0.9.1, the account tests should be back to strings

@n8maninger ok cool, all passing locally now, should be good.

@n8maninger
Copy link
Member

You can also update coreutils to v0.10.1

@n8maninger
Copy link
Member

That was a lot of prefixes 😅

@alexfreska alexfreska force-pushed the refactor_sdk_update_tests branch from 4a47b74 to fc7ed22 Compare January 19, 2025 00:16
Copy link
Member Author

alexfreska commented Jan 19, 2025

Merge activity

  • Jan 18, 8:14 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 18, 8:18 PM EST: Graphite rebased this pull request as part of a merge.
  • Jan 18, 8:19 PM EST: A user merged this pull request with Graphite.

@alexfreska alexfreska changed the base branch from nate/v2-signing to graphite-base/895 January 19, 2025 01:15
@alexfreska alexfreska changed the base branch from graphite-base/895 to main January 19, 2025 01:16
@alexfreska alexfreska force-pushed the refactor_sdk_update_tests branch from fc7ed22 to afada87 Compare January 19, 2025 01:17
@alexfreska alexfreska merged commit 7b66b4d into main Jan 19, 2025
29 of 35 checks passed
@alexfreska alexfreska deleted the refactor_sdk_update_tests branch January 19, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants