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

Commit

Permalink
henlo
Browse files Browse the repository at this point in the history
  • Loading branch information
Devon Bear committed Oct 7, 2023
1 parent 029e656 commit 21ead7e
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 1,717 deletions.
18 changes: 2 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ test-localnet-no-build:
###############################################################################

format:
@$(MAKE) license-fix buf-lint-fix forge-lint-fix golines golangci-fix
@$(MAKE) license-fix buf-lint-fix forge-lint-fix golangci-fix

lint:
@$(MAKE) license buf-lint forge-lint golangci gosec
Expand Down Expand Up @@ -325,20 +325,6 @@ golangci-fix:
@go list -f '{{.Dir}}/...' -m | xargs golangci-lint run --timeout=10m --fix --concurrency 8 -v


#################
# golines #
#################

golines-install:
@echo "--> Installing golines"
@go install github.com/segmentio/golines

golines:
@$(MAKE) golines-install
@echo "--> Running golines"
@golines --reformat-tags --shorten-comments --write-output --max-len=99 -l ./.


#################
# license #
#################
Expand Down Expand Up @@ -432,5 +418,5 @@ repo-rinse: |
test-e2e test-e2e-no-build hive-setup hive-view test-hive \
test-hive-v test-localnet test-localnet-no-build format lint \
forge-lint-fix forge-lint golangci-install golangci golangci-fix \
golines-install golines license-install license license-fix \
license-install license license-fix \
gosec-install gosec buf-install buf-lint-fix buf-lint sync tidy repo-rinse
37 changes: 26 additions & 11 deletions cosmos/lib/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func SdkProposalToGovProposal(
return governance.IGovernanceModuleProposal{}, err
}

return governance.IGovernanceModuleProposal{
output := governance.IGovernanceModuleProposal{
Id: proposal.Id,
Messages: messages,
Status: int32(proposal.Status), // Status is an alias for int32.
Expand All @@ -252,16 +252,31 @@ func SdkProposalToGovProposal(
NoCount: proposal.FinalTallyResult.NoCount,
NoWithVetoCount: proposal.FinalTallyResult.NoWithVetoCount,
},
SubmitTime: uint64(proposal.SubmitTime.Unix()),
DepositEndTime: uint64(proposal.DepositEndTime.Unix()),
VotingStartTime: uint64(proposal.VotingStartTime.Unix()),
VotingEndTime: uint64(proposal.VotingEndTime.Unix()),
TotalDeposit: totalDeposit,
Metadata: proposal.Metadata,
Title: proposal.Title,
Summary: proposal.Summary,
Proposer: proposerAddr,
}, nil

TotalDeposit: totalDeposit,
Metadata: proposal.Metadata,
Title: proposal.Title,
Summary: proposal.Summary,
Proposer: proposerAddr,
}

if proposal.SubmitTime != nil {
output.DepositEndTime = uint64(proposal.DepositEndTime.Unix())
}

if proposal.DepositEndTime != nil {
output.DepositEndTime = uint64(proposal.DepositEndTime.Unix())
}

if proposal.VotingStartTime != nil {
output.VotingStartTime = uint64(proposal.VotingStartTime.Unix())
}

if proposal.VotingEndTime != nil {
output.VotingEndTime = uint64(proposal.VotingEndTime.Unix())
}

return output, nil
}

// ConvertMsgSubmitProposalToSdk is a helper function to convert a `MsgSubmitProposal` to the gov
Expand Down
54 changes: 0 additions & 54 deletions cosmos/main.go

This file was deleted.

30 changes: 0 additions & 30 deletions cosmos/precompile/bank/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,36 +475,6 @@ func FundAccount(
}
return bk.SendCoinsFromModuleToAccount(ctx, evmtypes.ModuleName, account, coins)
}

func getTestMetadata() []banktypes.Metadata {
return []banktypes.Metadata{
{
Name: "Berachain bera",
Symbol: "BERA",
Description: "The Bera.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "bera", Exponent: uint32(0), Aliases: []string{"bera"}},
{Denom: "nbera", Exponent: uint32(9), Aliases: []string{"nanobera"}},
{Denom: "abera", Exponent: uint32(18), Aliases: []string{"attobera"}},
},
Base: "abera",
Display: "bera",
},
{
Name: "Token",
Symbol: "TOKEN",
Description: "The native staking token of the Token Hub.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "1token", Exponent: uint32(5), Aliases: []string{"decitoken"}},
{Denom: "2token", Exponent: uint32(4), Aliases: []string{"centitoken"}},
{Denom: "3token", Exponent: uint32(7), Aliases: []string{"dekatoken"}},
},
Base: "utoken",
Display: "token",
},
}
}

func sdkCoinsToEvmCoins(sdkCoins sdk.Coins) []struct {
Amount *big.Int `json:"amount"`
Denom string `json:"denom"`
Expand Down
6 changes: 5 additions & 1 deletion cosmos/precompile/governance/governance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ var _ = Describe("Governance Precompile", func() {

// Embed the send msg into a proposal.
proposal := v1.MsgSubmitProposal{
Messages: []*codectypes.Any{msgAny},
InitialDeposit: sdk.NewCoins(sdk.NewCoin("abera", sdkmath.NewInt(100))),
Messages: []*codectypes.Any{msgAny},
Proposer: sdk.AccAddress([]byte("proposer")).String(),
Metadata: "metadata",
Title: "title",
}

// Marshal the proposal.
Expand Down
2 changes: 1 addition & 1 deletion cosmos/precompile/governance/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func setupGovTest(ctrl *gomock.Controller, caller sdk.AccAddress) (
msr := baseapp.NewMsgServiceRouter()

stakingParams := stakingtypes.DefaultParams()
stakingParams.BondDenom = "abgt"
stakingParams.BondDenom = "abera"
err := sk.SetParams(ctx, stakingParams)
if err != nil {
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions e2e/precompile/contracts/gov/governance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var _ = Describe("Call the Precompile Directly", func() {
// Send coins to the wrapper.
coins := []bbindings.CosmosCoin{
{
Denom: "abgt",
Denom: "abera",
Amount: amt,
},
}
Expand All @@ -110,7 +110,7 @@ var _ = Describe("Call the Precompile Directly", func() {
// Wrapper submits a proposal.
prop = getProposal(wrapperAddr, amt)
txr = tf.GenerateTransactOpts("alice")
tx, err = wrapper.Submit(txr, getTestProposal(prop), "abgt", amt)
tx, err = wrapper.Submit(txr, getTestProposal(prop), "abera", amt)
Expect(err).ToNot(HaveOccurred())
ExpectSuccessReceipt(tf.EthClient(), tx)

Expand Down Expand Up @@ -222,7 +222,7 @@ func getProposal(
},
InitialDeposit: []bindings.CosmosCoin{
{
Denom: "abgt",
Denom: "abera",
Amount: amount,
},
},
Expand Down
4 changes: 0 additions & 4 deletions e2e/precompile/polard/config/addrbook.json

This file was deleted.

Loading

0 comments on commit 21ead7e

Please sign in to comment.