Skip to content

Commit

Permalink
refactor: mark deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code committed Oct 9, 2024
1 parent 0698a42 commit 43e3542
Show file tree
Hide file tree
Showing 10 changed files with 1,150 additions and 2,227 deletions.
346 changes: 1 addition & 345 deletions contract/ICrossChain.go

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions proto/fx/gravity/crosschain/v1/legacy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,22 @@ message MsgRequestBatch {

// Deprecated: do not use
message MsgRequestBatchResponse { uint64 batch_nonce = 1; }

message MsgIncreaseBridgeFee {
option deprecated = true;
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "crosschain/MsgIncreaseBridgeFee";

string chain_name = 1;
uint64 transaction_id = 2;
string sender = 3;
cosmos.base.v1beta1.Coin add_bridge_fee = 4 [ (gogoproto.nullable) = false ];
}

message MsgIncreaseBridgeFeeResponse { option deprecated = true; }

message MsgOracleSetConfirmResponse { option deprecated = true; }

message MsgConfirmBatchResponse { option deprecated = true; }

message MsgBridgeCallConfirmResponse { option deprecated = true; }
31 changes: 1 addition & 30 deletions proto/fx/gravity/crosschain/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ service Msg {
// module parameters. The authority is hard-coded to the x/gov module account.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);

// Deprecated: do not use
rpc IncreaseBridgeFee(MsgIncreaseBridgeFee)
returns (MsgIncreaseBridgeFeeResponse);

Expand Down Expand Up @@ -136,8 +137,6 @@ message MsgOracleSetConfirm {
string chain_name = 5;
}

message MsgOracleSetConfirmResponse {}

message MsgOracleSetUpdatedClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgOracleSetUpdatedClaim";
Expand All @@ -150,8 +149,6 @@ message MsgOracleSetUpdatedClaim {
string chain_name = 7;
}

message MsgOracleSetUpdatedClaimResponse {}

message MsgSendToFxClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgSendToFxClaim";
Expand All @@ -171,8 +168,6 @@ message MsgSendToFxClaim {
string chain_name = 9;
}

message MsgSendToFxClaimResponse {}

message MsgBridgeCallClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgBridgeCallClaim";
Expand Down Expand Up @@ -200,8 +195,6 @@ message MsgBridgeCallClaim {
string tx_origin = 13;
}

message MsgBridgeCallClaimResponse {}

message MsgBridgeCallResultClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgBridgeCallResultClaim";
Expand All @@ -216,8 +209,6 @@ message MsgBridgeCallResultClaim {
string cause = 8;
}

message MsgBridgeCallResultClaimResponse {}

message MsgConfirmBatch {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgConfirmBatch";
Expand All @@ -230,8 +221,6 @@ message MsgConfirmBatch {
string chain_name = 6;
}

message MsgConfirmBatchResponse {}

message MsgSendToExternalClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgSendToExternalClaim";
Expand All @@ -244,8 +233,6 @@ message MsgSendToExternalClaim {
string chain_name = 6;
}

message MsgSendToExternalClaimResponse {}

message MsgBridgeTokenClaim {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgBridgeTokenClaim";
Expand All @@ -261,8 +248,6 @@ message MsgBridgeTokenClaim {
string chain_name = 9;
}

message MsgBridgeTokenClaimResponse {}

message MsgBridgeCallConfirm {
option (cosmos.msg.v1.signer) = "bridger_address";
option (amino.name) = "crosschain/MsgBridgeCallConfirm";
Expand All @@ -274,8 +259,6 @@ message MsgBridgeCallConfirm {
string signature = 5;
}

message MsgBridgeCallConfirmResponse {}

message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "crosschain/MsgUpdateParams";
Expand All @@ -293,18 +276,6 @@ message MsgUpdateParams {

message MsgUpdateParamsResponse {}

message MsgIncreaseBridgeFee {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "crosschain/MsgIncreaseBridgeFee";

string chain_name = 1;
uint64 transaction_id = 2;
string sender = 3;
cosmos.base.v1beta1.Coin add_bridge_fee = 4 [ (gogoproto.nullable) = false ];
}

message MsgIncreaseBridgeFeeResponse {}

message MsgUpdateChainOracles {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "crosschain/MsgUpdateChainOracles";
Expand Down
32 changes: 6 additions & 26 deletions solidity/contracts/bridge/ICrossChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {IBridgeCall} from "./IBridgeCall.sol";
// NOTE: if using an interface to invoke the precompiled contract
// need to use solidity version 0.8.10 and later.
interface ICrossChain is IBridgeCall {
// Deprecated: please use `IBridgeCall.bridgeCall`
function crossChain(
address _token,
string memory _receipt,
Expand All @@ -16,30 +17,20 @@ interface ICrossChain is IBridgeCall {
string memory _memo
) external payable returns (bool _result);

// Deprecated: please use `IBridgeCall.bridgeCall`
function cancelSendToExternal(
string memory _chain,
uint256 _txID
) external returns (bool _result);

// Deprecated: please use `IBridgeCall.bridgeCall`
function increaseBridgeFee(
string memory _chain,
uint256 _txID,
address _token,
uint256 _fee
) external payable returns (bool _result);

function cancelPendingBridgeCall(
string memory _chain,
uint256 _txID
) external returns (bool _result);

function addPendingPoolRewards(
string memory _chain,
uint256 _txID,
address _token,
uint256 _reward
) external payable returns (bool _result);

function bridgeCoinAmount(
address _token,
bytes32 _target
Expand All @@ -60,6 +51,7 @@ interface ICrossChain is IBridgeCall {
address _externalAddress
) external view returns (bool _result);

// Deprecated
event CrossChain(
address indexed sender,
address indexed token,
Expand All @@ -71,12 +63,14 @@ interface ICrossChain is IBridgeCall {
string memo
);

// Deprecated
event CancelSendToExternal(
address indexed sender,
string chain,
uint256 txID
);

// Deprecated
event IncreaseBridgeFee(
address indexed sender,
address indexed token,
Expand All @@ -99,20 +93,6 @@ interface ICrossChain is IBridgeCall {
bytes _memo
);

event CancelPendingBridgeCallEvent(
address indexed _sender,
string chain,
uint256 txID
);

event AddPendingPoolRewardsEvent(
address indexed sender,
address indexed token,
string chain,
uint256 txID,
uint256 reward
);

event ExecuteClaimEvent(
address indexed _sender,
uint256 _eventNonce,
Expand Down
2 changes: 1 addition & 1 deletion tests/contract/CrossChainTest.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions x/crosschain/precompile/cancel_send_to_external.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import (
evmtypes "github.com/functionx/fx-core/v8/x/evm/types"
)

// Deprecated: please use BridgeCallMethod
type CancelSendToExternalMethod struct {
*Keeper
Method abi.Method
Event abi.Event
}

// Deprecated: please use BridgeCallMethod
func NewCancelSendToExternalMethod(keeper *Keeper) *CancelSendToExternalMethod {
return &CancelSendToExternalMethod{
Keeper: keeper,
Expand Down
2 changes: 2 additions & 0 deletions x/crosschain/precompile/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import (
evmtypes "github.com/functionx/fx-core/v8/x/evm/types"
)

// Deprecated: please use BridgeCallMethod
type CrossChainMethod struct {
*Keeper
abi.Method
abi.Event
}

// Deprecated: please use BridgeCallMethod
func NewCrossChainMethod(keeper *Keeper) *CrossChainMethod {
return &CrossChainMethod{
Keeper: keeper,
Expand Down
2 changes: 2 additions & 0 deletions x/crosschain/precompile/increase_bridge_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import (
evmtypes "github.com/functionx/fx-core/v8/x/evm/types"
)

// Deprecated: please use BridgeCallMethod
type IncreaseBridgeFeeMethod struct {
*Keeper
abi.Method
abi.Event
}

// Deprecated: please use BridgeCallMethod
func NewIncreaseBridgeFeeMethod(keeper *Keeper) *IncreaseBridgeFeeMethod {
return &IncreaseBridgeFeeMethod{
Keeper: keeper,
Expand Down
Loading

0 comments on commit 43e3542

Please sign in to comment.