-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix(types): simplify types for init functions, cleanup contructors #345
Conversation
@@ -126,7 +126,7 @@ | |||
"dependencies": { | |||
"@dha-team/arbundles": "^1.0.1", | |||
"@permaweb/aoconnect": "^0.0.57", | |||
"arweave": "1.14.4", | |||
"arweave": "1.15.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this always makes me nervous. will do some validations across our clients (observer, ar-io-node, network-portal, arns.app) to validate if it causes any issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor version bump -- "Drop Node 16 Support". that semantic versioning 😂
4f1c3b6
to
bcd0970
Compare
it.skip('should be able to instantiate ARIO with a process and arweave', async () => { | ||
const ario = ARIO.init({ | ||
process: new AOProcess({ | ||
processId, | ||
}), | ||
arweave, | ||
}); | ||
assert(ario instanceof ARIOReadable); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this meant to be removed or unskipped?
The init overloads can be hard to parse. This hopefully introduces new types that can be extended if/when necessary. Addittionally adds e2e tests validating the instance types returned for all major classes. We can look to leverage unit tests more to avoid the entire docker setup when doing this simple type validations/checks.
bcd0970
to
a580d79
Compare
tests/e2e/esm/index.test.ts
Outdated
it('should be able to get a specific vault', async () => { | ||
const { items: vaults } = await ario.getVaults(); | ||
if (vaults.length > 0) { | ||
const vault = await ario.getVault({ | ||
address: vaults[0].address, | ||
vaultId: vaults[0].vaultId, | ||
}); | ||
assert.deepEqual(vault, { | ||
balance: 1, | ||
startTimestamp: 1729962428678, | ||
endTimestamp: 1731172028678, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem stable. that vault will end at 1731172028678. maybe just assert the types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, 1731172028678
is actually in GMT: Saturday, November 9, 2024 5:07:08.678 PM
I'm guessing this is just getting no vaults atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good besides the test nits -- can iterate
🎉 This PR is included in version 3.3.0-alpha.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I introduced a bug when adding
arweave
as an optional type in #337. It's easy to overlook what our overloadedinit
functions expect. This hopefully introduces new types that can be extended if/when necessary. Additionally, i've added e2e tests validating the instance types returned for all major classes. We can look to leverage unit tests more to avoid the entire docker setup when doing these simple type validations/checks.