-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b65dc65
commit d96cc53
Showing
5 changed files
with
42 additions
and
22 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
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,30 @@ | ||
import { encodeShortString } from '../src/utils/shortString'; | ||
import { IS_DEVNET, compiledErc20, getTestAccount, getTestProvider } from './fixtures'; | ||
|
||
describe('Declare and UDC Deploy Flow', () => { | ||
const provider = getTestProvider(); | ||
const account = getTestAccount(provider); | ||
const erc20ClassHash = '0x54328a1075b8820eb43caf0caa233923148c983742402dcfc38541dd843d01a'; | ||
|
||
test('ERC20 Declare', async () => { | ||
const declareTx = await account.declare({ | ||
classHash: erc20ClassHash, | ||
contract: compiledErc20, | ||
}); | ||
|
||
expect(declareTx).toHaveProperty('class_hash'); | ||
expect(declareTx.class_hash).toEqual(erc20ClassHash); | ||
}); | ||
|
||
test('UDC Deploy', async () => { | ||
const deployment = await account.deploy({ | ||
classHash: erc20ClassHash, | ||
callData: [encodeShortString('Token'), encodeShortString('ERC20'), account.address], | ||
salt: '123', | ||
unique: true, // Using true here so as not to clash with normal erc20 deploy in account and provider test | ||
isDevnet: IS_DEVNET, | ||
}); | ||
|
||
expect(deployment).toHaveProperty('transaction_hash'); | ||
}); | ||
}); |
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
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