-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹 specify endpoint "v2" version in appropriate situations (#375)
Signed-off-by: Ryan Goulding <[email protected]>
- Loading branch information
1 parent
626f5b6
commit 6e464f2
Showing
34 changed files
with
257 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@layerzerolabs/ua-devtools-evm-hardhat-test": minor | ||
"@layerzerolabs/omnicounter-devtools-evm": minor | ||
"@layerzerolabs/ua-devtools-evm-hardhat": minor | ||
"@layerzerolabs/protocol-devtools-evm": minor | ||
"@layerzerolabs/devtools-evm-hardhat": minor | ||
"@layerzerolabs/protocol-devtools": minor | ||
"@layerzerolabs/ua-devtools-evm": minor | ||
"@layerzerolabs/devtools-evm": minor | ||
"@layerzerolabs/ua-devtools": minor | ||
"@layerzerolabs/devtools": minor | ||
"@layerzerolabs/oapp-example": minor | ||
"@layerzerolabs/oft-example": minor | ||
--- | ||
|
||
Specify EndpointV2 with the "V2" suffix wherever appropriate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
packages/omnicounter-devtools-evm/src/omnicounter/factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import pMemoize from 'p-memoize' | ||
import { OmniCounter } from '@/omnicounter/sdk' | ||
import { createEndpointFactory } from '@layerzerolabs/protocol-devtools-evm' | ||
import { EndpointFactory } from '@layerzerolabs/protocol-devtools' | ||
import { createEndpointV2Factory } from '@layerzerolabs/protocol-devtools-evm' | ||
import { EndpointV2Factory } from '@layerzerolabs/protocol-devtools' | ||
import { OAppFactory } from '@layerzerolabs/ua-devtools' | ||
import { OmniContractFactory } from '@layerzerolabs/devtools-evm' | ||
|
||
/** | ||
* Syntactic sugar that creates an instance of EVM `OmniCounter` SDK based on an `OmniPoint` with help of an | ||
* `OmniContractFactory` and an (optional) `EndpointFactory` | ||
* `OmniContractFactory` and an (optional) `EndpointV2Factory` | ||
* | ||
* @param {OmniContractFactory} contractFactory | ||
* @param {EndpointFactory} [endpointFactory] | ||
* @returns {EndpointFactory<Endpoint>} | ||
* @param {EndpointV2Factory} [EndpointV2Factory] | ||
* @returns {EndpointV2Factory<Endpoint>} | ||
*/ | ||
export const createOmniCounterFactory = ( | ||
contractFactory: OmniContractFactory, | ||
endpointFactory: EndpointFactory = createEndpointFactory(contractFactory) | ||
): OAppFactory<OmniCounter> => pMemoize(async (point) => new OmniCounter(await contractFactory(point), endpointFactory)) | ||
EndpointV2Factory: EndpointV2Factory = createEndpointV2Factory(contractFactory) | ||
): OAppFactory<OmniCounter> => | ||
pMemoize(async (point) => new OmniCounter(await contractFactory(point), EndpointV2Factory)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
...ocol-devtools-evm/src/endpoint/factory.ts → ...ol-devtools-evm/src/endpointv2/factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import pMemoize from 'p-memoize' | ||
import type { EndpointFactory, Uln302Factory } from '@layerzerolabs/protocol-devtools' | ||
import type { EndpointV2Factory, Uln302Factory } from '@layerzerolabs/protocol-devtools' | ||
import type { OmniPoint } from '@layerzerolabs/devtools' | ||
import type { OmniContractFactory } from '@layerzerolabs/devtools-evm' | ||
import { Endpoint } from './sdk' | ||
import { EndpointV2 } from './sdk' | ||
import { createUln302Factory } from '@/uln302/factory' | ||
|
||
/** | ||
* Syntactic sugar that creates an instance of EVM `Endpoint` SDK | ||
* based on an `OmniPoint` with help of an `OmniContractFactory` | ||
* | ||
* @param {OmniContractFactory} contractFactory | ||
* @returns {EndpointFactory<Endpoint>} | ||
* @param {Uln302Factory} uln302Factory | ||
* @returns {EndpointV2Factory<EndpointV2>} | ||
*/ | ||
export const createEndpointFactory = <TOmniPoint = never>( | ||
export const createEndpointV2Factory = <TOmniPoint = never>( | ||
contractFactory: OmniContractFactory<TOmniPoint | OmniPoint>, | ||
uln302Factory: Uln302Factory = createUln302Factory(contractFactory) | ||
): EndpointFactory<Endpoint, TOmniPoint | OmniPoint> => | ||
pMemoize(async (point) => new Endpoint(await contractFactory(point), uln302Factory)) | ||
): EndpointV2Factory<EndpointV2, TOmniPoint | OmniPoint> => | ||
pMemoize(async (point) => new EndpointV2(await contractFactory(point), uln302Factory)) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './dvn' | ||
export * from './endpoint' | ||
export * from './endpointv2' | ||
export * from './executor' | ||
export * from './priceFeed' | ||
export * from './uln302' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './dvn' | ||
export * from './endpoint' | ||
export * from './endpointv2' | ||
export * from './executor' | ||
export * from './priceFeed' | ||
export * from './uln302' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.