generated from KyberNetwork/go-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add txorigin to tradelogs v1 and solver table to tradelogs v2
- Loading branch information
1 parent
553ac00
commit 70be5e1
Showing
11 changed files
with
254 additions
and
17 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
2 changes: 2 additions & 0 deletions
2
cmd/tradelogs/migrations/000014_add_txorigin_to_tradelogs.up.sql
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,2 @@ | ||
ALTER TABLE tradelogs | ||
ADD COLUMN tx_origin TEXT DEFAULT NULL; |
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,23 @@ | ||
package rpcnode | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/ethereum/go-ethereum/ethclient" | ||
) | ||
|
||
func TestGetSender(t *testing.T) { | ||
t.Skip("need rpc url") | ||
rpcURL := "" | ||
ethClient, err := ethclient.Dial(rpcURL) | ||
if err != nil { | ||
panic(err) | ||
} | ||
rpcnode := NewClient(nil, ethClient) | ||
from, err := rpcnode.GetTxOriginByTxHash(context.Background(), "0x9570e65ab98a007f69e485a8c90ec7256cffedb9d7983cf8d2f0a566ea3c46a3") | ||
if err != nil { | ||
t.Log(err) | ||
} | ||
t.Log(from) | ||
} |
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,75 @@ | ||
CREATE TABLE IF NOT EXISTS solver ( | ||
address TEXT NOT NULL, | ||
solver_name TEXT NOT NULL, | ||
PRIMARY KEY(address) | ||
); | ||
|
||
INSERT INTO solver (address, solver_name) VALUES | ||
('0x9dfc9bb0fff2dc96728d2bb94eacee6ba3592351', 'cow-Rizzolver'), | ||
('0x2854c9a92cd1dc65bddf45afe397d9d75d4718c8', 'cow-Rizzolver'), | ||
('0x4fc4a61a3b99a1ad4a61b03f3752ca12b4a17646', 'cow-Rizzolver'), | ||
('0x34717040928d7fd8154d4612f3228eff14521023', 'cow-Laita'), | ||
('0xd0ba1b1782fbde45edab392428f60e14827d08ec', 'cow-Laita'), | ||
('0x95480d3f27658e73b2785d30beb0c847d78294c7', 'cow-Fractal'), | ||
('0x755bae1cd46c9c27a3230aef0ce923bda13d29f7', 'cow-Fractal'), | ||
('0x2a2883ade8ce179265f12fc7b48a4b50b092f1fd', 'cow-Fractal'), | ||
('0xab11302cb4f7c417e527a4d39c22aa9f04edb07d', 'cow-Fractal'), | ||
('0x4339889fd9dfca20a423fba011e9dff1c856caeb', 'cow-GlueX_Protocol'), | ||
('0x08924194cedd747dc85025b2b30a98d3ae1ce21d', 'cow-GlueX_Protocol'), | ||
('0xbada5552a3e5e2fb57db982e29257821a2cf192d', 'cow-Project_Blanc'), | ||
('0xc7899ff6a3ac2ff59261bd960a8c880df06e1041', 'cow-Barter'), | ||
('0xbf54079c9bc879ae4dd6bc79bce11d3988fd9c2b', 'cow-Barter'), | ||
('0x5f7a6aeec3d3e80558278632954da4b730996f83', 'cow-Barter'), | ||
('0xb9332b6301e5983272c30dd5b48a4e3b1664511b', 'cow-Baseline'), | ||
('0x01246d541e732d7f15d164331711edff217e4665', 'cow-Baseline'), | ||
('0x00806daa2cfe49715ea05243ff259deb195760fc', 'cow-Quasilabs'), | ||
('0x9b7e7f21d98f21c0354035798c40e9040e25787f', 'cow-Quasilabs'), | ||
('0x68005a99946447be44d594832e1b164f6c034e63', 'cow-Quasilabs'), | ||
('0x8f70a86c1309d8b1f5befc58948e7386fd495875', 'cow-Tsolver'), | ||
('0xa432cea087311d7cd07925d70f799ee94e7893a4', 'cow-Tsolver'), | ||
('0xc10d4dfda62227d9ec23ab0010e2942e48338a60', 'cow-Apollo'), | ||
('0xa08b00576aee8d8dd960e08298fac9fd7c756e36', 'cow-Apollo'), | ||
('0x0ddcb0769a3591230caa80f85469240b71442089', 'cow-Seasolver'), | ||
('0xac6cc8e2f0232b5b213503257c861235f4ed42c1', 'cow-Seasolver'), | ||
('0xe3067c7c27c1038de4e8ad95a83b927d23dfbd99', 'cow-PLM'), | ||
('0x27ac9ed6b768d232855473600a7880a974b71780', 'cow-PLM'), | ||
('0x28b1bd44996105b5c14c4de41093226ff78a4eb1', 'cow-0x'), | ||
('0xcc73072b53697911ff394ae01d3de59c9900b0b0', 'cow-0x'), | ||
('0x6f799f4bf6c1c56fb8d890e9e0fff2934b0de157', 'cow-Gnosis_1inch'), | ||
('0x8616dcdfcecbde13ccd89eac358dc5abda79ec31', 'cow-Gnosis_1inch'), | ||
('0x2224eaacc7c2dbf85d5355bab9e9271e01d30b55', 'cow-Sector_Finance'), | ||
('0xc9f2e6ea1637e499406986ac50ddc92401ce1f58', 'cow-PropellerSwap'), | ||
('0x3bf7c0e1728fb64bb0973b1e2a342f1c7eb1bb8e', 'cow-PropellerSwap'), | ||
('0x9528e8c42f7e109baded964e2d927fd5b6ca71e9', 'cow-Odos'), | ||
('0xf13eaf9093a210ebdaba581f5448ffa545ee2e65', 'cow-Odos'), | ||
('0x0ab21031124af2165586fbb495d93725a372c227', 'cow-Enso'), | ||
('0xeada531bc5361c9287088d857512e0ca812eaa68', 'cow-Enso'), | ||
('0xa883710b6dbf008a1cc25722c54583e35884a209', 'cow-Horadrim'), | ||
('0x2c3a1c33d96c9dca1c34eb234b1e65f79deae60e', 'cow-Horadrim'), | ||
('0x8a75ee64b4a40f679ad98bcc38312702971e07b7', 'cow-OneBit_Quant'), | ||
('0xe2823b5bd541ba8bff3d4bf55396567440772eab', 'cow-OneBit_Quant'), | ||
('0xd50ecb485dcf5d97266122dfed979587dd8923ac', 'cow-Gnosis_BalancerSOR'), | ||
('0x849bbdf910465913272a8262dda44279a82c5c76', 'cow-Gnosis_BalancerSOR'), | ||
('0xc74b656bd2ebe313d26d1ac02bcf95b137d1c857', 'cow-Gnosis_0x'), | ||
('0xa697c60706210a5ec6f9ccce364c507e604d9462', 'cow-Gnosis_0x'), | ||
('0xdd2e786980cd58acc5f64807b354c981f4094936', 'cow-Gnosis_ParaSwap'), | ||
('0x460aac34690189911ccb49d36e55ab548cf8a9a1', 'cow-Gnosis_ParaSwap'), | ||
('0xff662eedb413273b6727e1f59755607ca6876044', 'cow-OpenOcean_Aggregator'), | ||
('0x9902f0b57b6b8b2fa7339cd3efe0710cf63c86d6', 'cow-OpenOcean_Aggregator'), | ||
('0xbeaf89aec78a2990be29e2a317feed6b75bc78cd', 'cow-Quasimodo'), | ||
('0xaac451d13cf8d6915f859f4c7bc26da2df10eca6', 'cow-Quasimodo'), | ||
('0x8646ee3c5e82b495be8f9fe2f2f213701eed0edc', 'cow-Seasolver_v2'), | ||
('0x94aef67903bfe8bf65193a78074c887ba901d043', 'cow-Seasolver_v2'), | ||
('0x16c473448e770ff647c69cbe19e28528877fba1b', 'cow-Copium_Capital'), | ||
('0x008300082c3000009e63680088f8c7f4d3ff2e87', 'cow-Copium_Capital'), | ||
('0x8e8c00ad7011aabea0e06e984cfa7194cf8b16b0', 'cow-Copium_Capital'), | ||
('0xa5559c2e1302c5ce82582a6b1e4aec562c2fbcf4', 'cow-Project_Blanc'), | ||
('0xbada55babee5d2b7f3b551f9da846838760e068c', 'cow-Project_Blanc'), | ||
('0xd1508a211d98bb81195dc1f9533edcdf68adf036', 'cow-Furucombo'), | ||
('0x279fb872beaf64e94890376725c423c0820eda97', 'cow-Furucombo'), | ||
('0x6bf97afe2d2c790999cded2a8523009eb8a0823f', 'cow-Portus'), | ||
('0x5131590ca2e9d3edc182581352b289dcae83430c', 'cow-Portus'), | ||
('0x1a7a08423ab83e7939bf1df95952347d425e0a0a', 'cow-Naive'), | ||
('0x854490ef1d402d4f6fce05abefe1c676eb0dcd74', 'cow-ApeOut_1Inch'), | ||
('0x047a2fbe8aef590d4eb8942426a24970af301875', 'cow-Laertes'), | ||
('0xdf4296e752fd08b2d7db4101b98a48b74e59fd56', 'cow-Legacy'); |
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,22 @@ | ||
package types | ||
|
||
import "strings" | ||
|
||
type Solver struct { | ||
Address string `db:"address" json:"address"` | ||
SolverName string `db:"solver_name" json:"solver_name"` | ||
} | ||
|
||
func (o *Solver) SerializeSolver() []interface{} { | ||
return []interface{}{ | ||
strings.ToLower(o.Address), | ||
o.SolverName, | ||
} | ||
} | ||
|
||
func SolverColumns() []string { | ||
return []string{ | ||
"address", | ||
"solver_name", | ||
} | ||
} |