Skip to content

Commit

Permalink
shift addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Sep 12, 2024
1 parent 40584d0 commit 34240e5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/components/Editor/EditorPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const EditorPanels = ({ show }: EditorPanelsProps) => {
break;
default:
fileName =
accountNumber == '0x05'
accountNumber == '0x06'
? `${accountNumber}-Default`
: `${accountNumber}`;
script =
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/FileExplorer/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const AccountList = ({ isExplorerCollapsed }: AccountListProps) => {
const rawAddress = account.address.slice(-2);
const accountAddress = `0x${rawAddress}`;
const finalAddress =
accountAddress == '0x05'
accountAddress == '0x06'
? `${accountAddress}-Default`
: `${accountAddress}`;
const contractName = getDeployedContracts(account);
Expand Down
4 changes: 2 additions & 2 deletions src/providers/Project/projectDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ access(all) contract HelloWorld {

export const DEFAULT_ACCOUNT_STATE = '{}';

const DEFAULT_TRANSACTION = `import HelloWorld from 0x05
const DEFAULT_TRANSACTION = `import HelloWorld from 0x06
transaction(greeting: String) {
Expand All @@ -56,7 +56,7 @@ transaction(greeting: String) {
}
`;

const DEFAULT_SCRIPT = `import HelloWorld from 0x05
const DEFAULT_SCRIPT = `import HelloWorld from 0x06
access(all) fun main(): String {
return HelloWorld.hello()
Expand Down
8 changes: 4 additions & 4 deletions src/templates/js/helpers/getNameByAddress.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = (address) => {
const addressBook = {
'0x05': 'Alice',
'0x06': 'Bob',
'0x07': 'Charlie',
'0x08': 'Dave',
'0x06': 'Alice',
'0x07': 'Bob',
'0x08': 'Charlie',
'0x09': 'Dave',
};

return addressBook[address];
Expand Down
2 changes: 1 addition & 1 deletion src/util/accounts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const accountAddressIndexes = ['5', '6', '7', '8', '9'];
const accountAddresses = ['0x05', '0x06', '0x07', '0x08', '0x09'];
const accountAddresses = ['0x06', '0x07', '0x08', '0x09', '0x0a'];
export const storageMapByIndex = (index: number): string => {
if (index < 0) return null;
return accountAddresses[index];
Expand Down
10 changes: 5 additions & 5 deletions src/util/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export const prettify = (code: string): string => {

export const getNameByAddress = (address: string) => {
const addressBook: any = {
'0x05': 'Alice',
'0x06': 'Bob',
'0x07': 'Charlie',
'0x08': 'Dave',
'0x06': 'Alice',
'0x07': 'Bob',
'0x08': 'Charlie',
'0x09': 'Dave',
};

return addressBook[address];
Expand Down Expand Up @@ -55,7 +55,7 @@ export const getAccountCalls = (template: string) => {
};

export const filterExisting = (accounts: string[]): string[] => {
return ['0x05', '0x06', '0x07', '0x08'].filter(
return ['0x06', '0x07', '0x08', '0x09'].filter(
(item) => !accounts.includes(item),
);
};
Expand Down

0 comments on commit 34240e5

Please sign in to comment.