Skip to content

Commit

Permalink
Fix: new change fee structure
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 17, 2024
1 parent 0858160 commit 518e62e
Show file tree
Hide file tree
Showing 29 changed files with 396 additions and 368 deletions.
16 changes: 8 additions & 8 deletions cmd/api/docs/docs.go

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

16 changes: 8 additions & 8 deletions cmd/api/docs/swagger.json

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

16 changes: 8 additions & 8 deletions cmd/api/docs/swagger.yaml

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

8 changes: 4 additions & 4 deletions cmd/api/handler/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (s *AddressTestSuite) TestTransactions() {
q.Set("offset", "0")
q.Set("sort", "desc")
q.Set("status", "success")
q.Set("action_types", "sequence")
q.Set("action_types", "rollup_data_submission")
q.Set("height", "1000")

req := httptest.NewRequest(http.MethodGet, "/?"+q.Encode(), nil)
Expand Down Expand Up @@ -242,7 +242,7 @@ func (s *AddressTestSuite) TestTransactions() {
s.Require().EqualValues(10, tx.GasWanted)
s.Require().EqualValues(8, tx.GasUsed)
s.Require().EqualValues(10, tx.Nonce)
s.Require().EqualValues([]string{types.ActionTypeSequence.String()}, tx.ActionTypes)
s.Require().EqualValues([]string{types.ActionTypeRollupDataSubmission.String()}, tx.ActionTypes)
s.Require().EqualValues(1, tx.ActionsCount)
s.Require().Equal("codespace", tx.Codespace)
s.Require().Equal(types.StatusSuccess, tx.Status)
Expand Down Expand Up @@ -273,7 +273,7 @@ func (s *AddressTestSuite) TestActions() {
AddressId: 1,
ActionId: 1,
TxId: 1,
ActionType: types.ActionTypeSequence,
ActionType: types.ActionTypeRollupDataSubmission,
Height: 100,
Time: testTime,
Address: &testAddress,
Expand All @@ -298,7 +298,7 @@ func (s *AddressTestSuite) TestActions() {
s.Require().EqualValues(1, action.Id)
s.Require().EqualValues(100, action.Height)
s.Require().EqualValues(1, action.Position)
s.Require().EqualValues(types.ActionTypeSequence, action.Type)
s.Require().EqualValues(types.ActionTypeRollupDataSubmission, action.Type)
}

func (s *AddressTestSuite) TestCount() {
Expand Down
10 changes: 5 additions & 5 deletions cmd/api/handler/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var (
Height: 100,
Time: testTime,
Position: 1,
Type: types.ActionTypeSequence,
Type: types.ActionTypeRollupDataSubmission,
TxId: 1,
Data: map[string]any{
"rollup_id": hex.EncodeToString(testRollup.AstriaId),
Expand All @@ -120,7 +120,7 @@ var (
Signature: testsuite.RandomHash(32),
Signer: &testAddress,
SignerId: testAddress.Id,
ActionTypes: types.ActionTypeSequenceBits,
ActionTypes: types.ActionTypeRollupDataSubmissionBits,
Actions: []storage.Action{
*testRollupAction.Action,
},
Expand Down Expand Up @@ -371,7 +371,7 @@ func (s *BlockTestSuite) TestGetActions() {
Height: 100,
Time: testTime,
Position: 2,
Type: types.ActionTypeSequence,
Type: types.ActionTypeRollupDataSubmission,
TxId: 10,
Data: map[string]any{
"test": "value",
Expand All @@ -392,7 +392,7 @@ func (s *BlockTestSuite) TestGetActions() {
s.Require().EqualValues(100, actions[0].Height)
s.Require().EqualValues(2, actions[0].Position)
s.Require().Equal(testTime, actions[0].Time)
s.Require().Equal(types.ActionTypeSequence, actions[0].Type)
s.Require().Equal(types.ActionTypeRollupDataSubmission, actions[0].Type)
s.Require().Equal(hex.EncodeToString(testTx.Hash), actions[0].TxHash)
}

Expand Down Expand Up @@ -443,7 +443,7 @@ func (s *BlockTestSuite) TestGetRollupActions() {
s.Require().EqualValues(100, action.Height)
s.Require().EqualValues(1, action.Position)
s.Require().Equal(testTime, action.Time)
s.Require().EqualValues(string(types.ActionTypeSequence), action.Type)
s.Require().EqualValues(string(types.ActionTypeRollupDataSubmission), action.Type)
}

func (s *BlockTestSuite) TestGetRollupActionsCount() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/handler/responses/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Action struct {
Height pkgTypes.Level `example:"1000" format:"int64" json:"height" swaggertype:"integer"`
Time time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time" swaggertype:"string"`
Position int64 `example:"1" format:"int64" json:"position" swaggertype:"integer"`
Type types.ActionType `example:"sequence" format:"string" json:"type" swaggertype:"string"`
Type types.ActionType `example:"rollup_data_submission" format:"string" json:"type" swaggertype:"string"`
TxHash string `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" format:"binary" json:"tx_hash,omitempty" swaggertype:"string"`

Fee *Fee `json:"fee,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/handler/responses/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Block struct {
AppHash pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"app_hash" swaggertype:"string"`
LastResultsHash pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"last_results_hash" swaggertype:"string"`
EvidenceHash pkgTypes.Hex `example:"652452A670018D629CC116E510BA88C1CABE061336661B1F3D206D248BD558AF" json:"evidence_hash" swaggertype:"string"`
ActionTypes []string `example:"sequence,transfer" json:"action_types" swaggertype:"string"`
ActionTypes []string `example:"rollup_data_submission,transfer" json:"action_types" swaggertype:"string"`
Proposer *ShortValidator `json:"proposer,omitempty"`

Stats *BlockStats `json:"stats,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/handler/responses/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Tx struct {
Signer string `example:"115F94D8C98FFD73FE65182611140F0EDC7C3C94" format:"string" json:"signer" swaggertype:"string"`
Time time.Time `example:"2023-07-04T03:10:57+00:00" format:"date-time" json:"time" swaggertype:"string"`
Status types.Status `example:"success" format:"string" json:"status" swaggertype:"string"`
ActionTypes []string `example:"sequence,transfer" format:"string" json:"action_types" swaggertype:"string"`
ActionTypes []string `example:"rollup_data_submission,transfer" format:"string" json:"action_types" swaggertype:"string"`

Actions []Action `json:"actions,omitempty"`
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/api/handler/rollup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (s *RollupTestSuite) TestActions() {
Action: &storage.Action{
Data: map[string]any{},
Position: 1,
Type: types.ActionTypeSequence,
Type: types.ActionTypeRollupDataSubmission,
Id: 1,
Height: 100,
},
Expand All @@ -188,7 +188,7 @@ func (s *RollupTestSuite) TestActions() {
s.Require().EqualValues(1, action.Id)
s.Require().EqualValues(100, action.Height)
s.Require().EqualValues(1, action.Position)
s.Require().EqualValues(types.ActionTypeSequence, action.Type)
s.Require().EqualValues(types.ActionTypeRollupDataSubmission, action.Type)
}

func (s *RollupTestSuite) TestCount() {
Expand Down Expand Up @@ -333,7 +333,7 @@ func (s *RollupTestSuite) TestAllActions() {
Action: storage.Action{
Data: map[string]any{},
Position: 1,
Type: types.ActionTypeSequence,
Type: types.ActionTypeRollupDataSubmission,
Id: 1,
Height: 100,
},
Expand All @@ -354,7 +354,7 @@ func (s *RollupTestSuite) TestAllActions() {
s.Require().EqualValues(1, action.Id)
s.Require().EqualValues(100, action.Height)
s.Require().EqualValues(1, action.Position)
s.Require().EqualValues(types.ActionTypeSequence, action.Type)
s.Require().EqualValues(types.ActionTypeRollupDataSubmission, action.Type)
}

func (s *RollupTestSuite) TestDeposits() {
Expand Down
Loading

0 comments on commit 518e62e

Please sign in to comment.