Skip to content

Commit 6f5ae65

Browse files
committed
Add bridge_workers field to Params message in EVM bridge module, enabling a list of authorized addresses for token unlocking. Update related protobuf and Go files to support new functionality, including serialization and deserialization methods.
1 parent 1a615bf commit 6f5ae65

File tree

4 files changed

+242
-30
lines changed

4 files changed

+242
-30
lines changed

api/junction/evmbridge/params.pulsar.go

Lines changed: 155 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/junction/evmbridge/params.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ message Params {
1111
option (amino.name) = "junction/x/evmbridge/Params";
1212
option (gogoproto.equal) = true;
1313

14-
14+
// bridge_workers defines the list of addresses authorized to unlock tokens
15+
repeated string bridge_workers = 1;
1516
}

x/evmbridge/types/params.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package types
22

33
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
45
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
56
)
67

@@ -13,7 +14,9 @@ func ParamKeyTable() paramtypes.KeyTable {
1314

1415
// NewParams creates a new Params instance
1516
func NewParams() Params {
16-
return Params{}
17+
return Params{
18+
BridgeWorkers: []string{},
19+
}
1720
}
1821

1922
// DefaultParams returns a default set of parameters
@@ -28,5 +31,11 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
2831

2932
// Validate validates the set of params
3033
func (p Params) Validate() error {
34+
// Validate each authorized bridge worker
35+
for _, worker := range p.BridgeWorkers {
36+
if _, err := sdk.AccAddressFromBech32(worker); err != nil {
37+
return err
38+
}
39+
}
3140
return nil
3241
}

0 commit comments

Comments
 (0)