@@ -139,8 +139,15 @@ import (
139
139
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
140
140
)
141
141
142
- // !IMPORTANT: testnet only (reece's addr)
143
- const POAAdmin = "manifest10r39fueph9fq7a6lgswu4zdsg8t3gxlqdwwncm"
142
+ func GetPoAAdmin () string {
143
+ // used only in e2e testing with interchaintest
144
+ if address := os .Getenv ("OVERRIDE_POA_ADMIN_ADDRESS" ); address != "" {
145
+ return address
146
+ }
147
+
148
+ // !IMPORTANT: testnet only (reece's addr). Change this to a mainnet address
149
+ return "manifest10r39fueph9fq7a6lgswu4zdsg8t3gxlqdwwncm"
150
+ }
144
151
145
152
// We pull these out so we can set them with LDFLAGS in the Makefile
146
153
var (
@@ -344,7 +351,7 @@ func NewApp(
344
351
app .ConsensusParamsKeeper = consensusparamkeeper .NewKeeper (
345
352
appCodec ,
346
353
runtime .NewKVStoreService (keys [consensusparamtypes .StoreKey ]),
347
- POAAdmin ,
354
+ GetPoAAdmin () ,
348
355
runtime.EventService {},
349
356
)
350
357
bApp .SetParamStore (app .ConsensusParamsKeeper .ParamsStore )
@@ -371,14 +378,14 @@ func NewApp(
371
378
maccPerms ,
372
379
authcodec .NewBech32Codec (sdk .GetConfig ().GetBech32AccountAddrPrefix ()),
373
380
sdk .GetConfig ().GetBech32AccountAddrPrefix (),
374
- POAAdmin ,
381
+ GetPoAAdmin () ,
375
382
)
376
383
app .BankKeeper = bankkeeper .NewBaseKeeper (
377
384
appCodec ,
378
385
runtime .NewKVStoreService (keys [banktypes .StoreKey ]),
379
386
app .AccountKeeper ,
380
387
BlockedAddresses (),
381
- POAAdmin ,
388
+ GetPoAAdmin () ,
382
389
logger ,
383
390
)
384
391
@@ -387,7 +394,7 @@ func NewApp(
387
394
runtime .NewKVStoreService (keys [stakingtypes .StoreKey ]),
388
395
app .AccountKeeper ,
389
396
app .BankKeeper ,
390
- POAAdmin ,
397
+ GetPoAAdmin () ,
391
398
authcodec .NewBech32Codec (sdk .GetConfig ().GetBech32ValidatorAddrPrefix ()),
392
399
authcodec .NewBech32Codec (sdk .GetConfig ().GetBech32ConsensusAddrPrefix ()),
393
400
)
@@ -398,7 +405,7 @@ func NewApp(
398
405
app .AccountKeeper ,
399
406
app .BankKeeper ,
400
407
authtypes .FeeCollectorName ,
401
- POAAdmin ,
408
+ GetPoAAdmin () ,
402
409
)
403
410
404
411
app .DistrKeeper = distrkeeper .NewKeeper (
@@ -408,15 +415,15 @@ func NewApp(
408
415
app .BankKeeper ,
409
416
app .StakingKeeper ,
410
417
authtypes .FeeCollectorName ,
411
- POAAdmin ,
418
+ GetPoAAdmin () ,
412
419
)
413
420
414
421
app .SlashingKeeper = slashingkeeper .NewKeeper (
415
422
appCodec ,
416
423
legacyAmino ,
417
424
runtime .NewKVStoreService (keys [slashingtypes .StoreKey ]),
418
425
app .StakingKeeper ,
419
- POAAdmin ,
426
+ GetPoAAdmin () ,
420
427
)
421
428
422
429
app .POAKeeper = poakeeper .NewKeeper (
@@ -436,7 +443,7 @@ func NewApp(
436
443
invCheckPeriod ,
437
444
app .BankKeeper ,
438
445
authtypes .FeeCollectorName ,
439
- POAAdmin ,
446
+ GetPoAAdmin () ,
440
447
app .AccountKeeper .AddressCodec (),
441
448
)
442
449
@@ -451,7 +458,7 @@ func NewApp(
451
458
app .CircuitKeeper = circuitkeeper .NewKeeper (
452
459
appCodec ,
453
460
runtime .NewKVStoreService (keys [circuittypes .StoreKey ]),
454
- POAAdmin ,
461
+ GetPoAAdmin () ,
455
462
app .AccountKeeper .AddressCodec (),
456
463
)
457
464
app .BaseApp .SetCircuitBreaker (& app .CircuitKeeper )
@@ -487,7 +494,7 @@ func NewApp(
487
494
appCodec ,
488
495
homePath ,
489
496
app .BaseApp ,
490
- POAAdmin ,
497
+ GetPoAAdmin () ,
491
498
)
492
499
493
500
app .IBCKeeper = ibckeeper .NewKeeper (
@@ -497,7 +504,7 @@ func NewApp(
497
504
app .StakingKeeper ,
498
505
app .UpgradeKeeper ,
499
506
scopedIBCKeeper ,
500
- POAAdmin ,
507
+ GetPoAAdmin () ,
501
508
)
502
509
503
510
// Register the proposal types
@@ -523,7 +530,7 @@ func NewApp(
523
530
app .DistrKeeper ,
524
531
app .MsgServiceRouter (),
525
532
govConfig ,
526
- POAAdmin ,
533
+ GetPoAAdmin () ,
527
534
)
528
535
529
536
app .GovKeeper = * govKeeper .SetHooks (
@@ -558,7 +565,7 @@ func NewApp(
558
565
app .MintKeeper ,
559
566
app .BankKeeper ,
560
567
logger ,
561
- POAAdmin ,
568
+ GetPoAAdmin () ,
562
569
)
563
570
564
571
// Create the TokenFactory Keeper
@@ -570,7 +577,7 @@ func NewApp(
570
577
app .DistrKeeper ,
571
578
tokenFactoryCapabilities ,
572
579
app .POAKeeper .IsAdmin ,
573
- POAAdmin ,
580
+ GetPoAAdmin () ,
574
581
)
575
582
576
583
// IBC Fee Module keeper
@@ -592,7 +599,7 @@ func NewApp(
592
599
app .AccountKeeper ,
593
600
app .BankKeeper ,
594
601
scopedTransferKeeper ,
595
- POAAdmin ,
602
+ GetPoAAdmin () ,
596
603
)
597
604
598
605
app .ICAHostKeeper = icahostkeeper .NewKeeper (
@@ -605,7 +612,7 @@ func NewApp(
605
612
app .AccountKeeper ,
606
613
scopedICAHostKeeper ,
607
614
app .MsgServiceRouter (),
608
- POAAdmin ,
615
+ GetPoAAdmin () ,
609
616
)
610
617
app .ICAControllerKeeper = icacontrollerkeeper .NewKeeper (
611
618
appCodec ,
@@ -616,7 +623,7 @@ func NewApp(
616
623
app .IBCKeeper .PortKeeper ,
617
624
scopedICAControllerKeeper ,
618
625
app .MsgServiceRouter (),
619
- POAAdmin ,
626
+ GetPoAAdmin () ,
620
627
)
621
628
622
629
// Set legacy router for backwards compatibility with gov v1beta1
@@ -841,6 +848,8 @@ func NewApp(
841
848
app .ScopedICAHostKeeper = scopedICAHostKeeper
842
849
app .ScopedICAControllerKeeper = scopedICAControllerKeeper
843
850
851
+ app .setAnteHandler (txConfig )
852
+
844
853
// In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
845
854
// antehandlers, but are run _after_ the `runMsgs` execution. They are also
846
855
// defined as a chain, and have the same signature as antehandlers.
@@ -1123,7 +1132,7 @@ func BlockedAddresses() map[string]bool {
1123
1132
}
1124
1133
1125
1134
// allow the following addresses to receive funds
1126
- delete (modAccAddrs , POAAdmin )
1135
+ delete (modAccAddrs , govtypes . ModuleName )
1127
1136
1128
1137
return modAccAddrs
1129
1138
}
0 commit comments