From 777932c3e4db83faf29b5b92f562cd63a0b7ddb1 Mon Sep 17 00:00:00 2001 From: Rodrigo <95635797+poly-rodr@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:56:42 -0300 Subject: [PATCH] naming --- .../exchange_order_builder_impl_test.go | 24 +++++++++---------- pkg/model/module.go | 4 ++-- pkg/utils/module.go | 4 ++-- pkg/utils/module_test.go | 12 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkg/builder/exchange_order_builder_impl_test.go b/pkg/builder/exchange_order_builder_impl_test.go index 44de25d..dac42ff 100644 --- a/pkg/builder/exchange_order_builder_impl_test.go +++ b/pkg/builder/exchange_order_builder_impl_test.go @@ -99,7 +99,7 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err := builder.BuildOrderHash(order, model.Exchange) + orderHash, err := builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -119,7 +119,7 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.Exchange) + orderHash, err = builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -143,7 +143,7 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.NegRiskExchange) + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -163,7 +163,7 @@ func TestBuildOrderHash(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.NegRiskExchange) + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -189,7 +189,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err := builder.BuildOrderHash(order, model.Exchange) + orderHash, err := builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -213,7 +213,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.Exchange) + orderHash, err = builder.BuildOrderHash(order, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -241,7 +241,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.NegRiskExchange) + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -265,7 +265,7 @@ func TestBuildOrderSignature(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, order) - orderHash, err = builder.BuildOrderHash(order, model.NegRiskExchange) + orderHash, err = builder.BuildOrderHash(order, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, orderHash) @@ -291,7 +291,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }, model.Exchange) + }, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) @@ -321,7 +321,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }, model.Exchange) + }, model.CTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) @@ -354,7 +354,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }, model.NegRiskExchange) + }, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) @@ -384,7 +384,7 @@ func TestBuildSignedOrder(t *testing.T) { Side: model.BUY, FeeRateBps: "100", Nonce: "0", - }, model.NegRiskExchange) + }, model.NegRiskCTFExchange) assert.NoError(t, err) assert.NotNil(t, signedOrder) diff --git a/pkg/model/module.go b/pkg/model/module.go index a7e3702..0e2dc88 100644 --- a/pkg/model/module.go +++ b/pkg/model/module.go @@ -3,6 +3,6 @@ package model type VerifyingContract = int const ( - Exchange VerifyingContract = iota - NegRiskExchange + CTFExchange VerifyingContract = iota + NegRiskCTFExchange ) diff --git a/pkg/utils/module.go b/pkg/utils/module.go index 6140c2d..c09263f 100644 --- a/pkg/utils/module.go +++ b/pkg/utils/module.go @@ -16,9 +16,9 @@ func GetVerifyingContractAddress(chainId *big.Int, contract model.VerifyingContr } switch contract { - case model.Exchange: + case model.CTFExchange: return contracts.Exchange, nil - case model.NegRiskExchange: + case model.NegRiskCTFExchange: return contracts.NegRiskExchange, nil } diff --git a/pkg/utils/module_test.go b/pkg/utils/module_test.go index 1714ed6..fde932c 100644 --- a/pkg/utils/module_test.go +++ b/pkg/utils/module_test.go @@ -11,27 +11,27 @@ import ( func TestGetVerifyingContractAddress(t *testing.T) { // mumbai - contract, err := GetVerifyingContractAddress(big.NewInt(80001), model.Exchange) + contract, err := GetVerifyingContractAddress(big.NewInt(80001), model.CTFExchange) assert.NoError(t, err) assert.Equal(t, common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E").Hex(), contract.Hex()) - contract, err = GetVerifyingContractAddress(big.NewInt(80001), model.NegRiskExchange) + contract, err = GetVerifyingContractAddress(big.NewInt(80001), model.NegRiskCTFExchange) assert.NoError(t, err) assert.Equal(t, common.HexToAddress("0xC5d563A36AE78145C45a50134d48A1215220f80a").Hex(), contract.Hex()) // polygon mainnet - contract, err = GetVerifyingContractAddress(big.NewInt(137), model.Exchange) + contract, err = GetVerifyingContractAddress(big.NewInt(137), model.CTFExchange) assert.NoError(t, err) assert.Equal(t, common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E").Hex(), contract.Hex()) - contract, err = GetVerifyingContractAddress(big.NewInt(137), model.NegRiskExchange) + contract, err = GetVerifyingContractAddress(big.NewInt(137), model.NegRiskCTFExchange) assert.NoError(t, err) assert.Equal(t, common.HexToAddress("0xC5d563A36AE78145C45a50134d48A1215220f80a").Hex(), contract.Hex()) // wrong network - _, err = GetVerifyingContractAddress(big.NewInt(1), model.Exchange) + _, err = GetVerifyingContractAddress(big.NewInt(1), model.CTFExchange) assert.Error(t, err) - _, err = GetVerifyingContractAddress(big.NewInt(1), model.NegRiskExchange) + _, err = GetVerifyingContractAddress(big.NewInt(1), model.NegRiskCTFExchange) assert.Error(t, err) }