-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { erc721Mocks } from '@api3/airnode-protocol'; | ||
import { ethers } from 'ethers'; | ||
import * as local from '../../src/workers/local-handlers'; | ||
import { operation } from '../fixtures'; | ||
import { increaseTestTimeout, deployAirnodeAndMakeRequests, fetchAllLogNames } from '../setup/e2e'; | ||
|
@@ -6,14 +8,29 @@ increaseTestTimeout(); | |
|
||
it('deploys a requesterAuthorizerWithErc721 contract and authorizes requests', async () => { | ||
const requests = [operation.buildFullRequest()]; | ||
const { provider, deployment } = await deployAirnodeAndMakeRequests(__filename, requests); | ||
const { provider, deployment, deployerIndex, mnemonic } = await deployAirnodeAndMakeRequests(__filename, requests); | ||
|
||
// Send the NFT to the requester | ||
const deployer = provider.getSigner(deployerIndex); | ||
This comment has been minimized.
Sorry, something went wrong.
Siegrift
Author
Contributor
|
||
const onERC721ReceivedArguments = ethers.utils.defaultAbiCoder.encode( | ||
This comment has been minimized.
Sorry, something went wrong.
Siegrift
Author
Contributor
|
||
['address', 'uint256', 'address'], | ||
[ethers.Wallet.fromMnemonic(mnemonic).address, 31337, deployment.requesters.MockRrpRequesterFactory] | ||
); | ||
await erc721Mocks.MockErc721Factory.connect(deployment.erc721s.MockErc721Factory, deployer)[ | ||
'safeTransferFrom(address,address,uint256,bytes)' | ||
]( | ||
await deployer.getAddress(), | ||
deployment.authorizers.MockRequesterAuthorizerWithErc721Factory, | ||
0, | ||
onERC721ReceivedArguments | ||
); | ||
|
||
// Configure authorizers so that only the requesterAuthorizersWithErc721 can authorize | ||
// An empty requesterEndpointAuthorizers array means that no authorizers are required hence the 0x0... | ||
const erc721Address = deployment.erc721s.MockErc721Factory; | ||
const requesterAuthorizersWithErc721Address = deployment.authorizers.MockRequesterAuthorizerWithErc721Factory; | ||
const config = local.loadConfig(); | ||
config.chains[0].authorizers.requesterEndpointAuthorizers = []; | ||
config.chains[0].authorizers.requesterEndpointAuthorizers = ['0x0000000000000000000000000000000000000000']; | ||
This comment has been minimized.
Sorry, something went wrong.
dcroote
Contributor
|
||
config.chains[0].authorizers.crossChainRequesterAuthorizers = []; | ||
config.chains[0].authorizers.crossChainRequesterAuthorizersWithErc721 = []; | ||
config.chains[0].authorizers.requesterAuthorizersWithErc721 = [ | ||
|
I had the same thought and added
DEBUG
level logging elsewhere (so that the log is generated independent of authorizer). The e2e now outputs: