-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add paseo, fix UX, whitelist paseo people separatelly (#371)
Closes #370 -> add paseo to UI, + whitelist paseo people separately from common pattern of parity and w3f Closes #365 -> fix UX --------- Co-authored-by: Javier Bullrich <[email protected]>
- Loading branch information
Showing
15 changed files
with
154 additions
and
21 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 |
---|---|---|
|
@@ -130,4 +130,8 @@ button:focus-visible { | |
font-size: 16px; | ||
} | ||
|
||
.dropdown a { | ||
color: white; | ||
} | ||
|
||
@tailwind utilities; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script lang="ts"> | ||
import Faucet from "$lib/components/Faucet.svelte"; | ||
import { Paseo, type NetworkData } from "$lib/utils/networkData"; | ||
import faqMd from "$lib/assets/FAQ.md?raw"; | ||
let network: NetworkData = Paseo; | ||
let faq: string = faqMd | ||
.replaceAll("<NETWORK-TOKEN>", network.currency) | ||
.replaceAll("<NETWORK-NAME>", network.networkName); | ||
</script> | ||
|
||
<Faucet {network} {faq} /> |
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,6 @@ | ||
import { FaucetTests } from "./faucet.js"; | ||
|
||
const chains = [{ name: "Paseo Relay", id: -1 }]; | ||
|
||
const tests = new FaucetTests({ faucetName: "Paseo Faucet", chains, url: "/paseo", expectTransactionLink: false }); | ||
tests.runTests(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// eslint-disable-next-line unused-imports/no-unused-vars-ts | ||
export const getNetworkData = jest.fn((networkName: string) => { | ||
if (process.env.SMF_CONFIG_NETWORK == "paseo") { | ||
return { | ||
balanceCap: 500, | ||
chains: [], | ||
currency: "PAS", | ||
decimals: 10, | ||
dripAmount: "100", | ||
explorer: null, | ||
networkName: "Paseo", | ||
rpcEndpoint: "wss://paseo.rpc.amforc.com/", | ||
matrixWhitelistPatterns: [ | ||
/^@erin:parity\.io$/, | ||
/^@mak:parity\.io$/, | ||
/^@alexbird:parity\.io$/, | ||
/^@pierre:parity\.io$/, | ||
/^@hectorest06:matrix\.org$/, | ||
/^@tbaut:matrix\.org$/, | ||
/^@al3mart:matrix\.org$/, | ||
/^@purpletentacle:matrix\.org$/, | ||
/^@carlosala:matrix\.org$/, | ||
], | ||
}; | ||
} else { | ||
return { | ||
balanceCap: 1000, | ||
chains: [ | ||
{ name: "Rococo Relay Chain", id: -1 }, | ||
{ name: "Rockmine", id: 1000 }, | ||
{ name: "Contracts", id: 1002 }, | ||
{ name: "Encointer Lietaer", id: 1003 }, | ||
{ name: "Bridgehub", id: 1013 }, | ||
], | ||
currency: "ROC", | ||
decimals: 12, | ||
dripAmount: "100", | ||
explorer: "https://rococo.subscan.io", | ||
networkName: "Rococo", | ||
rpcEndpoint: "wss://rococo-rpc.polkadot.io/", | ||
matrixWhitelistPatterns: [/^.*:parity.io$/, /^.*:web3.foundation$/], | ||
}; | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import { config } from "src/config"; | ||
import { getNetworkData } from "src/networkData"; | ||
|
||
export function isAccountPrivileged(sender: string): boolean { | ||
return sender.endsWith(":parity.io") || sender.endsWith(":web3.foundation"); | ||
const networkName = config.Get("NETWORK"); | ||
const networkData = getNetworkData(networkName); | ||
|
||
return networkData.matrixWhitelistPatterns.some((pattern) => pattern.test(sender)); | ||
} |