Skip to content

Commit

Permalink
strips down unnecessary initialization code
Browse files Browse the repository at this point in the history
Signed-off-by: stadolf <[email protected]>
  • Loading branch information
elmariachi111 committed Jan 17, 2024
1 parent 9370b75 commit 5060c6b
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions test/Permissioner.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,34 @@ contract PermissionerTest is Test {
address bob = makeAddr("bob");
uint256 bobPk;

string ipfsUri = "ipfs://bafkreiankqd3jvpzso6khstnaoxovtyezyatxdy7t2qzjoolqhltmasqki";
string agreementCid = "bafkreigk5dvqblnkdniges6ft5kmuly47ebw4vho6siikzmkaovq6sjstq";
uint256 MINTING_FEE = 0.001 ether;
string DEFAULT_SYMBOL = "IPT-0001";

IPNFT internal ipnft;
Tokenizer internal tokenizer;
IPToken ipToken;
TermsAcceptedPermissioner internal permissioner;

function setUp() public {

(alice, alicePk) = makeAddrAndKey("alice");
(bob, bobPk) = makeAddrAndKey("bob");
vm.startPrank(deployer);

vm.startPrank(deployer);
ipnft = IPNFT(address(new ERC1967Proxy(address(new IPNFT()), "")));
ipnft.initialize();
ipnft.setAuthorizer(new AcceptAllAuthorizer());

permissioner = new TermsAcceptedPermissioner();

tokenizer = Tokenizer(address(new ERC1967Proxy(address(new Tokenizer()), "")));

BlindPermissioner blindPermissioner = new BlindPermissioner();
tokenizer.initialize(ipnft, blindPermissioner);
tokenizer.initialize(ipnft, new BlindPermissioner());
tokenizer.setIPTokenImplementation(new IPToken());

//ipToken = new IPToken();
//Metadata memory md = Metadata(1, originalOwner, "abcde");
//ipToken.initialize("foo", "BAR", md);

vm.stopPrank();

vm.deal(originalOwner, MINTING_FEE);

vm.startPrank(originalOwner);

vm.deal(originalOwner, 0.001 ether);
uint256 reservationId = ipnft.reserve();
ipnft.mintReservation{ value: MINTING_FEE }(originalOwner, reservationId, ipfsUri, DEFAULT_SYMBOL, "");

ipToken = tokenizer.tokenizeIpnft(1, 100_000, "IPT", agreementCid, "");
ipnft.mintReservation{ value: 0.001 ether }(originalOwner, reservationId, "", "", "");
ipToken = tokenizer.tokenizeIpnft(1, 100_000, "IPT", "bafkrei", "");
vm.stopPrank();

vm.startPrank(deployer);
tokenizer.reinit(permissioner);
vm.stopPrank();
Expand Down

0 comments on commit 5060c6b

Please sign in to comment.