Skip to content

Commit

Permalink
Merge branch 'evmos-stg' into evmos
Browse files Browse the repository at this point in the history
  • Loading branch information
DenSmolonski committed Dec 3, 2024
2 parents 593f715 + a970bbc commit 5387362
Show file tree
Hide file tree
Showing 588 changed files with 31,234 additions and 4,134 deletions.
2 changes: 1 addition & 1 deletion .env.custom
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APPLICATION_VERSION=1.52.0
APPLICATION_VERSION=1.58.0
21 changes: 20 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@
# (default=5)
# RELAY_THROTTLE_LIMIT=
# The API key to be used per chain.
# RELAY_PROVIDER_API_KEY_ARBITRUM_ONE=
# RELAY_PROVIDER_API_KEY_OPTIMISM=
# RELAY_PROVIDER_API_KEY_BSC=
# RELAY_PROVIDER_API_KEY_GNOSIS_CHAIN=
# RELAY_PROVIDER_API_KEY_POLYGON=
# RELAY_PROVIDER_API_KEY_POLYGON_ZKEVM=
# RELAY_PROVIDER_API_KEY_BASE=
# RELAY_PROVIDER_API_KEY_ARBITRUM_ONE=
# RELAY_PROVIDER_API_KEY_AVALANCHE=
# RELAY_PROVIDER_API_KEY_LINEA=
# RELAY_PROVIDER_API_KEY_BLAST=
# RELAY_PROVIDER_API_KEY_SEPOLIA=

# The cache TTL for each token price datapoint.
Expand Down Expand Up @@ -152,3 +160,14 @@

# Enable CowSwap TWAPs decoding feature
#FF_TWAPS_DECODING=

# Staking
#FF_NATIVE_STAKING=
#FF_NATIVE_STAKING_DECODING=
#STAKING_TESTNET_API_BASE_URI=
#STAKING_TESTNET_API_KEY=
#STAKING_API_BASE_URI=
#STAKING_API_KEY=

# Targeted Messaging
#FF_TARGETED_MESSAGING=
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# .git-blame-ignore-revs
# Change import statement paths to path aliases
4729440761cfe608ab8935d782238ae7fe55343b
# Enfore consistent usage of type imports
9804ceef5bcaa08feebc5ca412834fa04e023d7a
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ services:
INFURA_API_KEY: ${INFURA_API_KEY-example_api_key}
JWT_ISSUER: ${JWT_ISSUER-example_issuer}
JWT_TOKEN: ${JWT_TOKEN-example_token}
RELAY_PROVIDER_API_KEY_ARBITRUM_ONE: ${RELAY_PROVIDER_API_KEY_ARBITRUM_ONE-example_api_key}
RELAY_PROVIDER_API_KEY_OPTIMISM: ${RELAY_PROVIDER_API_KEY_OPTIMISM-example_api_key}
RELAY_PROVIDER_API_KEY_BSC: ${RELAY_PROVIDER_API_KEY_BSC-example_api_key}
RELAY_PROVIDER_API_KEY_GNOSIS_CHAIN: ${RELAY_PROVIDER_API_KEY_GNOSIS_CHAIN-example_api_key}
RELAY_PROVIDER_API_KEY_POLYGON: ${RELAY_PROVIDER_API_KEY_POLYGON-example_api_key}
RELAY_PROVIDER_API_KEY_POLYGON_ZKEVM: ${RELAY_PROVIDER_API_KEY_POLYGON_ZKEVM-example_api_key}
RELAY_PROVIDER_API_KEY_BASE: ${RELAY_PROVIDER_API_KEY_BASE-example_api_key}
RELAY_PROVIDER_API_KEY_ARBITRUM_ONE: ${RELAY_PROVIDER_API_KEY_ARBITRUM_ONE-example_api_key}
RELAY_PROVIDER_API_KEY_AVALANCHE: ${RELAY_PROVIDER_API_KEY_AVALANCHE-example_api_key}
RELAY_PROVIDER_API_KEY_LINEA: ${RELAY_PROVIDER_API_KEY_LINEA-example_api_key}
RELAY_PROVIDER_API_KEY_BLAST: ${RELAY_PROVIDER_API_KEY_BLAST-example_api_key}
RELAY_PROVIDER_API_KEY_SEPOLIA: ${RELAY_PROVIDER_API_KEY_SEPOLIA-example_api_key}
depends_on:
- redis
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,29 @@ export default tseslint.config(
'warn',
{ assertionStyle: 'as' },
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'warn',
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@safe-global/safe-deployments',
message:
'Please import from @/domain/common/utils/deployments instead.',
},
],
},
],
// TODO: Address these rules: (added to update to ESLint 9)
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/unbound-method': 'off',
// Added after typescript-eslint 8.1.0
'@typescript-eslint/prefer-promise-reject-errors': 'off',
},
},
eslintConfigPrettier,
Expand Down
69 changes: 69 additions & 0 deletions migrations/00005_notifications/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
DROP TABLE IF EXISTS push_notification_devices, notification_types, notification_subscriptions, notification_subscription_notification_types CASCADE;

--------------------------------------------------------
-- Push notification devices: 'ANDROID', 'IOS', 'WEB' --
--------------------------------------------------------
CREATE TABLE push_notification_devices (
id SERIAL PRIMARY KEY,
device_type VARCHAR(255) CHECK (device_type IN ('ANDROID', 'IOS', 'WEB')) NOT NULL,
device_uuid UUID NOT NULL UNIQUE,
cloud_messaging_token VARCHAR(255) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);

-- Update updated_at when device is updated to track validity of token
CREATE OR REPLACE TRIGGER update_push_notification_devices_updated_at
BEFORE UPDATE ON push_notification_devices
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();

--------------------------------------------
-- Notification types, e.g. INCOMING_TOKEN --
--------------------------------------------
CREATE TABLE notification_types (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE
);

INSERT INTO notification_types (name) VALUES
('CONFIRMATION_REQUEST'), -- PENDING_MULTISIG_TRANSACTION
('DELETED_MULTISIG_TRANSACTION'),
('EXECUTED_MULTISIG_TRANSACTION'),
('INCOMING_ETHER'),
('INCOMING_TOKEN'),
('MESSAGE_CONFIRMATION_REQUEST'), -- MESSAGE_CREATED
('MODULE_TRANSACTION');

-------------------------------------------
-- Safe subscriptions for a given device --
-------------------------------------------
CREATE TABLE notification_subscriptions (
id SERIAL PRIMARY KEY,
push_notification_device_id INT NOT NULL,
chain_id VARCHAR(255) NOT NULL,
safe_address VARCHAR(42) NOT NULL,
signer_address VARCHAR(42),
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
FOREIGN KEY (push_notification_device_id) REFERENCES push_notification_devices(id) ON DELETE CASCADE,
UNIQUE(chain_id, safe_address, push_notification_device_id, signer_address)
);

-- Update updated_at when a notification subscription is updated
CREATE OR REPLACE TRIGGER update_notification_subscriptions_updated_at
BEFORE UPDATE ON notification_subscriptions
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();

----------------------------------------------------
-- Join table for subscription/notification types --
----------------------------------------------------
CREATE TABLE notification_subscription_notification_types (
id SERIAL PRIMARY KEY,
notification_subscription_id INT NOT NULL,
notification_type_id INT NOT NULL,
FOREIGN KEY (notification_subscription_id) REFERENCES notification_subscriptions(id) ON DELETE CASCADE,
FOREIGN KEY (notification_type_id) REFERENCES notification_types(id) ON DELETE CASCADE,
UNIQUE(notification_subscription_id, notification_type_id)
);
45 changes: 45 additions & 0 deletions migrations/00006_targeted_messaging/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CREATE TABLE outreaches (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
start_date TIMESTAMP WITH TIME ZONE NOT NULL,
end_date TIMESTAMP WITH TIME ZONE NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
CONSTRAINT unique_outreach_name UNIQUE (name)
);

CREATE OR REPLACE TRIGGER update_outreaches_updated_at
BEFORE UPDATE ON outreaches
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();

CREATE TABLE targeted_safes (
id SERIAL PRIMARY KEY,
address VARCHAR(42) NOT NULL,
outreach_id INT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
FOREIGN KEY (outreach_id) REFERENCES outreaches(id) ON DELETE CASCADE,
CONSTRAINT unique_targeted_safe UNIQUE (address, outreach_id)
);

CREATE OR REPLACE TRIGGER update_targeted_safes_updated_at
BEFORE UPDATE ON targeted_safes
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();

CREATE TABLE submissions (
id SERIAL PRIMARY KEY,
targeted_safe_id INT NOT NULL,
signer_address VARCHAR(42) NOT NULL,
completion_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
FOREIGN KEY (targeted_safe_id) REFERENCES targeted_safes(id) ON DELETE CASCADE,
CONSTRAINT unique_submission UNIQUE (targeted_safe_id, signer_address)
);

CREATE OR REPLACE TRIGGER update_submissions_updated_at
BEFORE UPDATE ON submissions
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();
Loading

0 comments on commit 5387362

Please sign in to comment.