Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
chore: remove redundant field in response
Browse files Browse the repository at this point in the history
  • Loading branch information
wregulski committed Jan 3, 2024
1 parent b4c8e43 commit cfd9833
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion broadcast/internal/arc/arc_query_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func decodeQueryResponseBody(resp *http.Response, arc *ArcClient) (*broadcast.Qu
Miner: arc.apiURL,
},
BaseTxResponse: base,
MerklePath: base.MerklePath,
}

return model, nil
Expand Down
2 changes: 0 additions & 2 deletions broadcast/internal/arc/arc_query_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func TestDecodeQueryResponseBody(t *testing.T) {
BaseTxResponse: broadcast.BaseTxResponse{
MerklePath: fixtures.TxMerklePath,
},
MerklePath: fixtures.TxMerklePath,
},
},
{
Expand All @@ -128,7 +127,6 @@ func TestDecodeQueryResponseBody(t *testing.T) {
BaseResponse: broadcast.BaseResponse{
Miner: "http://example.com",
},
MerklePath: "",
},
},
}
Expand Down
2 changes: 0 additions & 2 deletions broadcast/internal/arc/arc_submit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func decodeSubmitResponseBody(resp *http.Response) (*broadcast.SubmittedTx, erro

model := &broadcast.SubmittedTx{
BaseSubmitTxResponse: base,
MerklePath: base.MerklePath,
}

return model, nil
Expand All @@ -227,7 +226,6 @@ func decodeSubmitBatchResponseBody(resp *http.Response) ([]*broadcast.SubmittedT
for _, tx := range base {
model = append(model, &broadcast.SubmittedTx{
BaseSubmitTxResponse: tx,
MerklePath: tx.MerklePath,
})
}

Expand Down
2 changes: 0 additions & 2 deletions broadcast/internal/arc/mocks/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ var (
TxID: fixtures.TxId,
},
},
MerklePath: fixtures.TxMerklePath,
}

SubmittedTxSecondary = &broadcast_api.SubmittedTx{
Expand All @@ -77,7 +76,6 @@ var (
TxID: fixtures.TxIdSecondary,
},
},
MerklePath: fixtures.TxMerklePathSecondary,
}
)

Expand Down
4 changes: 0 additions & 4 deletions broadcast/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ type BaseTxResponse struct {
type QueryTxResponse struct {
BaseResponse
BaseTxResponse
// MerklePath is the Merkle path used to calculate Merkle root of the block in which the transaction was included.
MerklePath string `json:"merklePath,omitempty"`
}

// BaseSubmitTxResponse is the internal response returned by the miner from submitting transaction(s).
Expand All @@ -44,8 +42,6 @@ type BaseSubmitTxResponse struct {
// SubmittedTx is the submit response with decoded Merkl Path.
type SubmittedTx struct {
BaseSubmitTxResponse
// MerklePath is the Merkle path used to calculate Merkle root of the block in which the transaction was included.
MerklePath string `json:"merklePath,omitempty"`
}

// SubmitTxResponse is the response returned by the SubmitTransaction method.
Expand Down
2 changes: 1 addition & 1 deletion examples/submit_transaction/submit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
logger := zerolog.Nop()
token := ""
apiURL := "https://arc.gorillapool.io"
tx := broadcast.Transaction{Hex: "0100000001ddb4c9848bdb3815df8615fa292cbd78d08df8ddcca030952893cd5323cde2d6070000006a4730440220217a28cce8e91a6aed468f55a3ff370b659243a1426bac54e969ee0bac66917702201e4325624ed092a72fe4bfdf7ab73c63b54d02ebfc2c281fe6b168aead3b81bf412102297bd70ae25fb4a13b4ce619dfa7c01711d7999a7ffa027869df61758a8128d1ffffffff08f4010000000000001976a914c762c78bc4166f1d612f444759690bd54543cd8788acf4010000000000001976a914cfb15128b34f29c0fef7281664f15f9e9b86b2c888acf4010000000000001976a9140c5a3b6a60c6e1eeb787ede1a03ae118ae3c437688ac88130000000000001976a914e4d0bd8a51c7524b895e00561310e51baa10c66c88acf4010000000000001976a914848b33504640a85cc8884144b656f92e704a253c88acf4010000000000001976a914e1d4a53aa9f3d11c7b5d1b532266b34d6a34181288ac0000000000000000fd2401006a22314d6a4a7251744a735959647a753254487872654e69524c53586548637a417778550a5361746f73656e6465720a746578742f706c61696e057574662d38017c223150755161374b36324d694b43747373534c4b79316b683536575755374d7455523503534554036170700a7361746f73656e64657204747970650c7265676973746572557365720c7061796d61696c204861736840373863613031353837646635373533323265623538386233623830623433313239633763636435383266343361303662623538363133353233323737613663340970686f6e65486173684039643535626465323661613139343364326234366463303665343735356139363536666564323062626632643839313138353339346139623431633034643539d3830700000000001976a91467ef6a452137dc349cf28ffe6893f782a704560388ac00000000"}
tx := broadcast.Transaction{Hex: "01000000026d9a56036235bb5b5e39b04b6f188c74bc45189a9122f235cad5f0c4b668817d000000006b483045022100ae4c9b06376c42bf82f7910de20bb025d8b43daf33eb2db1966f0f1fd361d499022063594799502920ceceb17e3301e44066431a5ae1e221ce1bd89b446e602adf62412102dd2063cc1d4fbc5a770b156f8cd9f5c80cc586df4c7d148444d6bb66c81a10daffffffff6e574c52ebc1c724a13d0afd525adbcfe0b134d9666ab9004240d9d072a7906b000000006a4730440220191c938793953f931c9297a27a651b07e5cb60432fd5750a3f53488ed23fae8702204c503822986ef959af741609dfe98a51004e36596ca52a865c5e029fdbcfb3d641210253085022df5ebbdc71f9e8f555443660cda4a3d36d732685be317d7e11b9eda4ffffffff0214000000000000001976a914553236189ff9fed552837b952e404e09f78c03fa88ac01000000000000001976a914d8f00ced3f960ffa6f0516b4e352e0a9feccc3af88ac00000000"}

cfg := broadcast_client.ArcClientConfig{
Token: token,
Expand Down

0 comments on commit cfd9833

Please sign in to comment.