Skip to content

Commit

Permalink
Merge pull request #1 from ronin-chain/chore/cleanup
Browse files Browse the repository at this point in the history
chore: add migrations code and adapt `cleanup` branch from bridge-core
  • Loading branch information
DNK90 authored Feb 26, 2024
2 parents 50398ff + e2d3ef9 commit 9f6734c
Show file tree
Hide file tree
Showing 30 changed files with 452 additions and 1,324 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Includes all subscriptions bridge is observing in a listener. Each subscription
- `to`: Indicates receiver/contract address that bridge uses as one of conditions to trigger a subscription
- `type`: There are 2 types, `0` is `transaction event` and `1` is `log's event`
- `handler`: Define contract and event that we want to listen
- `contract`: Contract name. This must be defined on repo [Bridge Contracts](https://github.com/axieinfinity/bridge-contracts/blob/master/main.go#L13-L20)
- `contract`: Contract name.
- `name`: The event name
- `callbacks`: List all callbacks function when data is decoded. This is a map (pair) where the key is listener's name and value is the function that is called in that listener. For example:

Expand Down Expand Up @@ -174,7 +174,7 @@ and submit the data to `HelloEth` contract via method `SubmitFromRonin`
"to": "0xA8D61A5427a778be28Bd9bb5990956b33385c738",
"type": 1,
"handler": {
"contract": "RoninGateway", // The contract name, it must be defined on [Bridge Contracts](https://github.com/axieinfinity/bridge-contracts/blob/master/main.go#L13-L20) first.
"contract": "RoninGateway", // The contract name
"name": "Welcome" // The event is listening
},
"callbacks": {
Expand Down
2 changes: 1 addition & 1 deletion cmd/bridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"github.com/axieinfinity/bridge-core/adapters"
bridgeCoreStore "github.com/axieinfinity/bridge-core/stores"
bridgeCoreUtils "github.com/axieinfinity/bridge-core/utils"
migration "github.com/axieinfinity/bridge-migrations"
"github.com/axieinfinity/bridge-v2/cmd/utils"
"github.com/axieinfinity/bridge-v2/internal/debug"
"github.com/axieinfinity/bridge-v2/migration"
"github.com/ethereum/go-ethereum/log"
"gopkg.in/urfave/cli.v1"
)
Expand Down
33 changes: 0 additions & 33 deletions contract_tests/EthGovernance.sol

This file was deleted.

34 changes: 0 additions & 34 deletions contract_tests/RoninGovernance.sol

This file was deleted.

20 changes: 0 additions & 20 deletions contract_tests/RoninTrustedOrganization.sol

This file was deleted.

269 changes: 0 additions & 269 deletions contract_tests/eth_governance.go

This file was deleted.

269 changes: 0 additions & 269 deletions contract_tests/ronin_governance.go

This file was deleted.

267 changes: 0 additions & 267 deletions contract_tests/ronin_trusted_org.go

This file was deleted.

15 changes: 5 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module github.com/axieinfinity/bridge-v2

replace github.com/ethereum/go-ethereum => github.com/axieinfinity/ronin v1.10.4-0.20240117085004-bf2f0d1787d0
replace (
github.com/axieinfinity/bridge-core => github.com/ronin-chain/bridge-core v0.1.3-0.20240226101641-8d0e69b8f633
github.com/ethereum/go-ethereum => github.com/axieinfinity/ronin v1.10.4-0.20240117085004-bf2f0d1787d0
)

go 1.20

Expand All @@ -21,27 +24,23 @@ require (

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/axieinfinity/bridge-contracts v0.0.0-20231004085724-072c76e1bf73
github.com/axieinfinity/bridge-core v0.1.3-0.20231019083704-13047bb9c3bf
github.com/axieinfinity/bridge-migrations v0.0.0-20230405070530-7bb3be2afe72
github.com/ethereum/go-ethereum v1.10.26
github.com/go-gormigrate/gormigrate/v2 v2.0.2
github.com/gorilla/websocket v1.5.0
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
gorm.io/driver/postgres v1.4.5
)

require (
github.com/VictoriaMetrics/fastcache v1.12.0 // indirect
github.com/axieinfinity/ronin-kms-client v0.0.0-20220805072849-960e04981b70 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/go-gormigrate/gormigrate/v2 v2.0.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand Down Expand Up @@ -76,7 +75,6 @@ require (
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/peterh/liner v1.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
Expand All @@ -103,11 +101,8 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
16 changes: 2 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/axieinfinity/bridge-contracts v0.0.0-20231004085724-072c76e1bf73 h1:+Y8ThUCfxdKrQWOPtrYvw/52Cq8GOkZzzTqqde1vK8I=
github.com/axieinfinity/bridge-contracts v0.0.0-20231004085724-072c76e1bf73/go.mod h1:/1xWUM5AIZGYgaFxl9ojlw3tCgeWF4SDg8qrzx5YHwk=
github.com/axieinfinity/bridge-core v0.1.3-0.20231019083704-13047bb9c3bf h1:sf+ie8f++UtoXWZ96R7DqcEUFBamiX2qBFYUyTR2+so=
github.com/axieinfinity/bridge-core v0.1.3-0.20231019083704-13047bb9c3bf/go.mod h1:5l7mgnWAkUNjiFxcYX95dWmSZP8xhoaL4Zt7kY3VYd0=
github.com/axieinfinity/bridge-migrations v0.0.0-20230405070530-7bb3be2afe72 h1:4vKU0kZJ3TzwtjV5smGIs2Y7bxFAt8SeZdqr4Cn7JGw=
github.com/axieinfinity/bridge-migrations v0.0.0-20230405070530-7bb3be2afe72/go.mod h1:867OEbEWDp965PZ44feJElRZz4RuNDceEbjCjWBbxe0=
github.com/axieinfinity/ronin v1.10.4-0.20240117085004-bf2f0d1787d0 h1:FkxiijPE9SyL0NmpQ40HQZgh/rq4950j7K0ppi6ORPM=
github.com/axieinfinity/ronin v1.10.4-0.20240117085004-bf2f0d1787d0/go.mod h1:+RTKka0gQcSOzoEGsJN3A49k5PPuUjU9tT6a7TC4T2g=
github.com/axieinfinity/ronin-kms-client v0.0.0-20220805072849-960e04981b70 h1:4MMSxt0Ce9cCN/XB+ESc/JllU1/jklFiIsWG4gq2y+g=
github.com/axieinfinity/ronin-kms-client v0.0.0-20220805072849-960e04981b70/go.mod h1:mU3WoP8bi4bB/GhbwTTojFb7B8HK37E91rM1qes1+wg=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -379,7 +371,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
Expand Down Expand Up @@ -415,6 +406,8 @@ github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/ronin-chain/bridge-core v0.1.3-0.20240226101641-8d0e69b8f633 h1:CJi2Pk250uLizec92o2taqcHd94sfuzt5nC+vwGfCc8=
github.com/ronin-chain/bridge-core v0.1.3-0.20240226101641-8d0e69b8f633/go.mod h1:X6QX0BsMR432Ez8ShNavbC0Sp7rtVthfGWdLtg174ag=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
Expand Down Expand Up @@ -597,7 +590,6 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -828,8 +820,6 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand All @@ -846,8 +836,6 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I=
google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
8 changes: 4 additions & 4 deletions listener/ronin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (

bridgeUtils "github.com/axieinfinity/bridge-v2/utils"

ethGovernance "github.com/axieinfinity/bridge-contracts/generated_contracts/ethereum/governance"
ethGovernance "github.com/axieinfinity/bridge-core/generated_contracts/ethereum/governance"
"github.com/ethereum/go-ethereum/crypto"

roninTrustedOrganization "github.com/axieinfinity/bridge-contracts/generated_contracts/ronin/trusted_organization"
roninTrustedOrganization "github.com/axieinfinity/bridge-core/generated_contracts/ronin/trusted_organization"

"github.com/axieinfinity/bridge-contracts/generated_contracts/ethereum/gateway"
gateway2 "github.com/axieinfinity/bridge-contracts/generated_contracts/ronin/gateway"
bridgeCore "github.com/axieinfinity/bridge-core"
"github.com/axieinfinity/bridge-core/generated_contracts/ethereum/gateway"
gateway2 "github.com/axieinfinity/bridge-core/generated_contracts/ronin/gateway"
bridgeCoreModels "github.com/axieinfinity/bridge-core/models"
bridgeCoreStores "github.com/axieinfinity/bridge-core/stores"
"github.com/axieinfinity/bridge-core/utils"
Expand Down
23 changes: 23 additions & 0 deletions migration/20220515_init/deposit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package models

import (
"gorm.io/gorm"
)

type Deposit struct {
ID int `json:"id" gorm:"primary_key:true;column:id;auto_increment;not null"`
Owner string `json:"owner" gorm:"column:owner;index:idx_deposit_owner;not null"`
TokenAddress string `json:"tokenAddress" gorm:"column:token_address;index:idx_deposit_token_address;not null"`
TokenNumber int `json:"tokenNumber" gorm:"column:token_number;not null"`
BlockNumber int64 `json:"blockNumber" gorm:"column:block_number;index:idx_deposit_block_number;not null"`
SidechainToken string `json:"sidechainToken" gorm:"column:sidechain_token;not null"`
Standard int `json:"standard" gorm:"column:standard;not null"`
}

func (m Deposit) BeforeCreate(tx *gorm.DB) (err error) {
return nil
}

func (m Deposit) TableName() string {
return "deposit"
}
19 changes: 19 additions & 0 deletions migration/20220515_init/event.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package models

import "gorm.io/gorm"

type Event struct {
ID int `json:"id" gorm:"primary_key:true;column:id;auto_increment;not null"`
EventName string `json:"eventName" gorm:"column:event_name;uniqueIndex:idx_event_event_name_tx;not null"`
TransactionHash string `json:"transactionHash" gorm:"column:transaction_hash;uniqueIndex:idx_event_event_name_tx;not null"`
FromChainId string `json:"fromChainId" gorm:"column:from_chain_id;not null"`
CreatedAt int64 `json:"created_at" gorm:"column:created_at;type:bigint;index:idx_event_created_at;not null"`
}

func (e Event) BeforeCreate(tx *gorm.DB) (err error) {
return nil
}

func (e Event) TableName() string {
return "event"
}
29 changes: 29 additions & 0 deletions migration/20220515_init/job.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package models

import (
"gorm.io/gorm"
)

type Job struct {
ID int `json:"id" gorm:"primary_key:true;column:id;auto_increment;not null"`
Listener string `json:"listener" gorm:"column:listener;index:idx_job_listener_name;not null"`
SubscriptionName string `json:"subscriptionName" gorm:"column:subscription_name;not null"`
Type int `json:"type" gorm:"column:type;not null"`
RetryCount int `json:"retryCount" gorm:"column:retry_count;not null"`
Status string `json:"status" gorm:"column:status;not null"`
Data string `json:"data" gorm:"column:data;not null"`
Transaction string `json:"transaction" gorm:"column:transaction;index:idx_job_transaction;not null"`
CreatedAt int64 `json:"created_at" gorm:"column:created_at;type:bigint;index:idx_job_created_at;not null"`
FromChainId string `json:"fromChainId" gorm:"column:from_chain_id;not null"`

// Method is used to execute function in `callback` job
Method string `json:"method" gorm:"column:method;not null"`
}

func (m Job) BeforeCreate(tx *gorm.DB) (err error) {
return nil
}

func (m Job) TableName() string {
return "job"
}
18 changes: 18 additions & 0 deletions migration/20220515_init/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package models

import (
"github.com/go-gormigrate/gormigrate/v2"
"gorm.io/gorm"
)

func Migrate() *gormigrate.Migration {
return &gormigrate.Migration{
ID: "20220515",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(&Deposit{}, &Event{}, &Job{}, &ProcessedBlock{}, &Task{}, &Withdrawal{})
},
Rollback: func(tx *gorm.DB) error {
return nil
},
}
}
19 changes: 19 additions & 0 deletions migration/20220515_init/processed_block.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package models

import (
"gorm.io/gorm"
)

type ProcessedBlock struct {
ID int `json:"id" gorm:"primary_key:true;column:id;auto_increment;not null"`
ChainId string `json:"chainId" gorm:"column:chain_id;not null"`
Block int64 `json:"block" gorm:"column:block;not null"`
}

func (m ProcessedBlock) BeforeCreate(tx *gorm.DB) (err error) {
return nil
}

func (m ProcessedBlock) TableName() string {
return "processed_block"
}
28 changes: 28 additions & 0 deletions migration/20220515_init/task.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package models

import (
"gorm.io/gorm"
)

type Task struct {
ID int `json:"id" gorm:"primary_key:true;column:id;auto_increment;not null"`
ChainId string `json:"chainId" gorm:"column:chain_id;index:idx_job_chain_id;not null"`
FromChainId string `json:"fromChainId" gorm:"column:from_chain_id;not null"`
Type string `json:"type" gorm:"column:task_type;not null"`
Data string `json:"data" gorm:"column:data;not null"`
Retries int `json:"retries" gorm:"column:retries;not null"`
Status string `json:"status" gorm:"column:status;not null"`
LastError string `json:"lastError" gorm:"column:last_error"`
TransactionHash string `json:"transactionHash" gorm:"transaction_hash;index:idx_task_transaction_hash;not null"`
FromTransaction string `json:"fromTransaction" gorm:"from_transaction;index:idx_task_from_transaction;not null"`
TransactionStatus int `json:"transactionStatus" gorm:"transaction_status;index:idx_task_transaction_status;not null"`
CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;index:idx_task_created_at;not null"`
}

func (m Task) BeforeCreate(tx *gorm.DB) (err error) {
return nil
}

func (m Task) TableName() string {
return "task"
}
Loading

0 comments on commit 9f6734c

Please sign in to comment.