Skip to content

Commit

Permalink
Support legacy versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeder committed May 1, 2024
1 parent 30c689d commit e974cb0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 2.1.3
## 2.1.4

- Support legacy versions by coercing them to full semver

Expand Down
7 changes: 6 additions & 1 deletion dist/eas.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/eas.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereum-attestation-service/eas-sdk",
"version": "2.1.3",
"version": "2.1.4",
"description": "Ethereum Attestation Service - TypeScript/JavaScript SDK",
"repository": "[email protected]:ethereum-attestation-service/eas-sdk.git",
"author": "Leonid Beder <[email protected]>",
Expand Down
7 changes: 6 additions & 1 deletion src/eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ export class EAS extends Base<EASContract> {
}

private async isLegacyContract() {
return semver.lte(await this.getVersion(), LEGACY_VERSION);
const version = await this.getVersion();
const fullVersion = semver.coerce(version);
if (!fullVersion) {
throw new Error(`Invalid version: ${version}`);
}
return semver.lte(fullVersion, LEGACY_VERSION);
}
}

0 comments on commit e974cb0

Please sign in to comment.