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

feat(PE-5758): add signer to ario class #20

Merged
merged 36 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7e08097
feat(signer): add arweave signer to ario class
Mar 16, 2024
bc7e577
fix(signer): remove jwk use, ignore web example for now
Mar 18, 2024
35ffab6
fix(arbundle version): pin version
Mar 18, 2024
dcdf171
chore: update example
Mar 18, 2024
2508bd9
chore: formatting
Mar 18, 2024
f32f738
chore: simplify constructor
Mar 18, 2024
d2ef573
fix(signer): remove use of JWK, simplify constructor (#22)
dtfiedler Mar 18, 2024
18f2b58
Merge remote-tracking branch 'origin/alpha' into PE-5758
Mar 18, 2024
c7f8eee
fix(signer): update ANT to have signer
Mar 20, 2024
4581b8d
fix(ant): add signer to ant test
Mar 20, 2024
faab4f3
fix(tests): use process vars as priority url
Mar 20, 2024
1395664
Merge branch 'alpha' into PE-5758
atticusofsparta Mar 20, 2024
fddba1e
fix(tests): use http not https in tests
Mar 20, 2024
bf41b60
chore(types): update types and methods on contract instances
Mar 21, 2024
a71befd
fix(tests): update docker compose params
Mar 21, 2024
feb29ba
Merge branch 'alpha' into PE-5758
atticusofsparta Mar 21, 2024
4b3c4c2
fix(ctrl flow): remove else from control flow
Mar 21, 2024
f02d83f
fix(arbundles): update arbundles import
Mar 21, 2024
2cd1b5c
fix(tests): update tests with new name
Mar 21, 2024
740d8b8
fix(contracts): remove write method and type from remote contract
Mar 21, 2024
10f30fe
fix(tests): use angela for testing
Mar 21, 2024
2c02e90
fix(types): update interaction type to only use read for now
Mar 22, 2024
87d6c90
fix(types): rename signer to ContractSigner
Mar 22, 2024
32530eb
fix(eslint): remove eslint comments and use this signer
Mar 22, 2024
1bdcfeb
fix(tests): update tests with constants and update types
Mar 22, 2024
4fae4a2
fix(contracts): add configuration view method and update types
Mar 22, 2024
5618690
Merge branch 'alpha' into PE-5758
atticusofsparta Mar 22, 2024
21224e2
fix(lint): formatting
Mar 22, 2024
b4a7bc3
fix(contract configuration): return cache url as well
Mar 22, 2024
9869415
fix(tests): instantiate new ant to connect in tests
Mar 22, 2024
060ee2c
fix(warp contract): added test for getting state after connecting wit…
Mar 22, 2024
2ac9427
fix(cache): remove cache folder
Mar 22, 2024
2867abc
fix(gitignore): remove cache from gitignore
Mar 22, 2024
a59f05c
fix(types and tests): update evalTo to allow undefined sortKey and bl…
Mar 22, 2024
f76a201
fix(tests): dont make blockHeight or sortKey undefined but rather evalTo
Mar 22, 2024
9d4bd9f
chore(readme): add docs on using connect
Mar 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function isContractTxIdConfiguration(
}

export type EvaluationOptions = {
evalTo?: { sortKey: SortKey } | { blockHeight: BlockHeight };
evalTo?: { sortKey?: SortKey } | { blockHeight?: BlockHeight };
// TODO: any other evaluation constraints
};

Expand Down
2 changes: 1 addition & 1 deletion src/common/contracts/warp-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class WarpContract<T> implements BaseContract<T>, ReadContract {
let sortKeyOrBlockHeight: string | number | undefined;
if (evalTo && 'sortKey' in evalTo) {
sortKeyOrBlockHeight = evalTo.sortKey;
} else if (evalTo && 'blockHeight') {
} else if (evalTo && 'blockHeight' in evalTo) {
sortKeyOrBlockHeight = evalTo.blockHeight;
}

Expand Down
18 changes: 18 additions & 0 deletions tests/ant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ describe('ANT contract apis', () => {
});

it.each([
[{ sortKey: undefined }],
Copy link
Collaborator

@dtfiedler dtfiedler Mar 22, 2024

Choose a reason for hiding this comment

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

ah sorry - meant [undefined] - we don't want to allow the the sortKey to be undefined

[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get contract state with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -52,7 +54,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(`should get record: ${JSON.stringify('%s')}`, async (evalTo) => {
const record = await ant.getRecord({
Expand All @@ -63,7 +67,9 @@ describe('ANT contract apis', () => {
});

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get records with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -74,7 +80,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get owner with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -85,7 +93,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get controllers with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -98,7 +108,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get name with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -109,7 +121,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get ticker with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -120,7 +134,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get balances with evaluation options: ${JSON.stringify('%s')}`,
Expand All @@ -131,7 +147,9 @@ describe('ANT contract apis', () => {
);

it.each([
[{ sortKey: undefined }],
[{ sortKey: evaluateToSortKey.toString() }],
[{ blockHeight: undefined }],
[{ blockHeight: evaluateToBlockHeight }],
])(
`should get balance with evaluation options: ${JSON.stringify('%s')}`,
Expand Down