Skip to content

Commit

Permalink
Use HexV2Field
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Mar 25, 2024
1 parent 9cc9c58 commit 97a9b27
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.10 on 2024-03-08 15:36
# Generated by Django 5.0.3 on 2024-03-25 13:34

import django.db.models.deletion
import django.utils.timezone
Expand All @@ -10,10 +10,11 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
("history", "0079_alter_erc20transfer_unique_together_and_more"),
("history", "0080_alter_multisigconfirmation_signature"),
]

operations = [
Expand Down Expand Up @@ -53,6 +54,66 @@ class Migration(migrations.Migration):
"abstract": False,
},
),
migrations.CreateModel(
name="SafeOperationConfirmation",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created",
model_utils.fields.AutoCreatedField(
default=django.utils.timezone.now,
editable=False,
verbose_name="created",
),
),
(
"modified",
model_utils.fields.AutoLastModifiedField(
default=django.utils.timezone.now,
editable=False,
verbose_name="modified",
),
),
("owner", gnosis.eth.django.models.EthereumAddressV2Field()),
(
"signature",
gnosis.eth.django.models.HexV2Field(
default=None, max_length=5000, null=True
),
),
(
"signature_type",
models.PositiveSmallIntegerField(
choices=[
(0, "CONTRACT_SIGNATURE"),
(1, "APPROVED_HASH"),
(2, "EOA"),
(3, "ETH_SIGN"),
],
db_index=True,
),
),
(
"safe_operation",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="confirmations",
to="account_abstraction.safeoperation",
),
),
],
options={
"ordering": ["created"],
},
),
migrations.CreateModel(
name="UserOperation",
fields=[
Expand Down Expand Up @@ -100,6 +161,15 @@ class Migration(migrations.Migration):
),
],
),
migrations.AddField(
model_name="safeoperation",
name="user_operation",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="safe_operation",
to="account_abstraction.useroperation",
),
),
migrations.CreateModel(
name="UserOperationReceipt",
fields=[
Expand Down Expand Up @@ -127,73 +197,11 @@ class Migration(migrations.Migration):
),
],
),
migrations.CreateModel(
name="SafeOperationConfirmation",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created",
model_utils.fields.AutoCreatedField(
default=django.utils.timezone.now,
editable=False,
verbose_name="created",
),
),
(
"modified",
model_utils.fields.AutoLastModifiedField(
default=django.utils.timezone.now,
editable=False,
verbose_name="modified",
),
),
("owner", gnosis.eth.django.models.EthereumAddressV2Field()),
(
"signature",
gnosis.eth.django.models.HexField(
default=None, max_length=5000, null=True
),
),
(
"signature_type",
models.PositiveSmallIntegerField(
choices=[
(0, "CONTRACT_SIGNATURE"),
(1, "APPROVED_HASH"),
(2, "EOA"),
(3, "ETH_SIGN"),
],
db_index=True,
),
),
(
"safe_operation",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="confirmations",
to="account_abstraction.safeoperation",
),
),
],
options={
"ordering": ["created"],
},
),
migrations.AddField(
model_name="safeoperation",
name="user_operation",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="safe_operation",
to="account_abstraction.useroperation",
migrations.AddConstraint(
model_name="safeoperationconfirmation",
constraint=models.UniqueConstraint(
fields=("safe_operation", "owner"),
name="unique_safe_operation_owner_confirmation",
),
),
migrations.AddIndex(
Expand All @@ -206,11 +214,4 @@ class Migration(migrations.Migration):
name="useroperation",
unique_together={("sender", "nonce")},
),
migrations.AddConstraint(
model_name="safeoperationconfirmation",
constraint=models.UniqueConstraint(
fields=("safe_operation", "owner"),
name="unique_safe_operation_owner_confirmation",
),
),
]
2 changes: 1 addition & 1 deletion safe_transaction_service/account_abstraction/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from gnosis.eth.account_abstraction import UserOperationMetadata
from gnosis.eth.django.models import (
EthereumAddressV2Field,
HexField,
HexV2Field,
Keccak256Field,
Uint256Field,
)
Expand Down

0 comments on commit 97a9b27

Please sign in to comment.