Skip to content

Commit

Permalink
Use snake case for default admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Dec 7, 2023
1 parent 6126031 commit 50b85f5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/core-cairo/src/custom.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ Generated by [AVA](https://avajs.dev).
}␊
#[constructor]␊
fn constructor(ref self: ContractState, defaultAdmin: ContractAddress) {␊
fn constructor(ref self: ContractState, default_admin: ContractAddress) {␊
self.accesscontrol.initializer();␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin);␊
}␊
}␊
`
Expand Down
Binary file modified packages/core-cairo/src/custom.test.ts.snap
Binary file not shown.
12 changes: 6 additions & 6 deletions packages/core-cairo/src/erc20.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ Generated by [AVA](https://avajs.dev).
}␊
#[constructor]␊
fn constructor(ref self: ContractState, defaultAdmin: ContractAddress, pauser: ContractAddress) {␊
fn constructor(ref self: ContractState, default_admin: ContractAddress, pauser: ContractAddress) {␊
self.erc20.initializer('MyToken', 'MTK');␊
self.accesscontrol.initializer();␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin);␊
self.accesscontrol._grant_role(PAUSER_ROLE, pauser);␊
}␊
Expand Down Expand Up @@ -715,11 +715,11 @@ Generated by [AVA](https://avajs.dev).
}␊
#[constructor]␊
fn constructor(ref self: ContractState, defaultAdmin: ContractAddress, minter: ContractAddress) {␊
fn constructor(ref self: ContractState, default_admin: ContractAddress, minter: ContractAddress) {␊
self.erc20.initializer('MyToken', 'MTK');␊
self.accesscontrol.initializer();␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin);␊
self.accesscontrol._grant_role(MINTER_ROLE, minter);␊
}␊
Expand Down Expand Up @@ -1046,7 +1046,7 @@ Generated by [AVA](https://avajs.dev).
fn constructor(␊
ref self: ContractState,␊
recipient: ContractAddress,␊
defaultAdmin: ContractAddress,␊
default_admin: ContractAddress,␊
pauser: ContractAddress,␊
minter: ContractAddress,␊
upgrader: ContractAddress,␊
Expand All @@ -1055,7 +1055,7 @@ Generated by [AVA](https://avajs.dev).
self.accesscontrol.initializer();␊
self.erc20._mint(recipient, 2000000000000000000000);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin);␊
self.accesscontrol._grant_role(PAUSER_ROLE, pauser);␊
self.accesscontrol._grant_role(MINTER_ROLE, minter);␊
self.accesscontrol._grant_role(UPGRADER_ROLE, upgrader);␊
Expand Down
Binary file modified packages/core-cairo/src/erc20.test.ts.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/core-cairo/src/erc721.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,11 @@ Generated by [AVA](https://avajs.dev).
}␊
#[constructor]␊
fn constructor(ref self: ContractState, defaultAdmin: ContractAddress, minter: ContractAddress) {␊
fn constructor(ref self: ContractState, default_admin: ContractAddress, minter: ContractAddress) {␊
self.erc721.initializer('MyToken', 'MTK');␊
self.accesscontrol.initializer();␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin);␊
self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin);␊
self.accesscontrol._grant_role(MINTER_ROLE, minter);␊
}␊
Expand Down
Binary file modified packages/core-cairo/src/erc721.test.ts.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/core-cairo/src/set-access-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export type Access = typeof accessOptions[number];
addSRC5Component(c);

c.addStandaloneImport('starknet::ContractAddress');
c.addConstructorArgument({ name: 'defaultAdmin', type: 'ContractAddress'});
c.addConstructorArgument({ name: 'default_admin', type: 'ContractAddress'});

c.addStandaloneImport('openzeppelin::access::accesscontrol::DEFAULT_ADMIN_ROLE');
c.addConstructorCode('self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, defaultAdmin)');
c.addConstructorCode('self.accesscontrol._grant_role(DEFAULT_ADMIN_ROLE, default_admin)');
}
break;
}
Expand Down

0 comments on commit 50b85f5

Please sign in to comment.