fix: `testRecipient` CLI bug (#3138)
### Description - we were recovering `TestRecipient` from sdk artifacts which means the deployer won't have ownership. So, I added a optional `shouldRecover` boolean which I turned off for TestRecipient deployer (this is only for our artifacts, if they have their own testRecipient, it will still recover that if provided) - moved `TestRecipientDeployer` from cli to sdk and removed duplicated code from infra ### Drive-by changes None ### Related issues - fixes https://github.com/hyperlane-xyz/issues/issues/895 ### Backward compatibility Yes ### Testing Manual (between anvil1 and optimismgoerli)pull/3142/head
parent
d3d7ad7f97
commit
67a6d971ed
@ -0,0 +1,7 @@ |
|||||||
|
--- |
||||||
|
'@hyperlane-xyz/infra': patch |
||||||
|
'@hyperlane-xyz/cli': patch |
||||||
|
'@hyperlane-xyz/sdk': patch |
||||||
|
--- |
||||||
|
|
||||||
|
Added `shouldRecover` flag to deployContractFromFactory so that the `TestRecipientDeployer` can deploy new contracts if it's not the owner of the prior deployments (We were recovering the SDK artifacts which meant the deployer won't be able to set the ISM as they needed) |
@ -1,36 +0,0 @@ |
|||||||
import { |
|
||||||
TestRecipient__factory, |
|
||||||
TestTokenRecipient__factory, |
|
||||||
} from '@hyperlane-xyz/core'; |
|
||||||
import { |
|
||||||
ChainName, |
|
||||||
HyperlaneDeployer, |
|
||||||
MultiProvider, |
|
||||||
} from '@hyperlane-xyz/sdk'; |
|
||||||
|
|
||||||
export const TEST_RECIPIENT_DEPLOYER_FACTORIES = { |
|
||||||
TestRecipient: new TestRecipient__factory(), |
|
||||||
TestTokenRecipient: new TestTokenRecipient__factory(), |
|
||||||
}; |
|
||||||
|
|
||||||
export class TestRecipientDeployer extends HyperlaneDeployer< |
|
||||||
never, |
|
||||||
typeof TEST_RECIPIENT_DEPLOYER_FACTORIES |
|
||||||
> { |
|
||||||
constructor(multiProvider: MultiProvider) { |
|
||||||
super(multiProvider, TEST_RECIPIENT_DEPLOYER_FACTORIES); |
|
||||||
} |
|
||||||
|
|
||||||
async deployContracts(chain: ChainName) { |
|
||||||
const TestRecipient = await this.deployContract(chain, 'TestRecipient', []); |
|
||||||
const TestTokenRecipient = await this.deployContract( |
|
||||||
chain, |
|
||||||
'TestTokenRecipient', |
|
||||||
[], |
|
||||||
); |
|
||||||
return { |
|
||||||
TestRecipient, |
|
||||||
TestTokenRecipient, |
|
||||||
}; |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue