@@ -15,21 +15,11 @@ import {
15
15
MsgCreateOracleScript ,
16
16
MsgEditOracleScript ,
17
17
MsgDeposit ,
18
- MsgVoteSignals ,
19
- MsgSubmitSignalPrices ,
20
- MsgUpdateReferenceSourceConfig ,
21
- MsgUpdateParams ,
22
18
} from '../src/message'
23
19
import { VoteOption } from '../codegen/cosmos/gov/v1beta1/gov_pb'
24
20
25
21
import fs from 'fs'
26
22
import path from 'path'
27
- import {
28
- Signal ,
29
- SignalPrice ,
30
- ReferenceSourceConfig ,
31
- } from '../codegen/band/feeds/v1beta1/feeds_pb'
32
- import { Params } from '../codegen/band/feeds/v1beta1/params_pb'
33
23
34
24
let coin = new Coin ( )
35
25
coin . setDenom ( 'uband' )
@@ -54,7 +44,7 @@ describe('MsgRequest', () => {
54
44
)
55
45
56
46
const anyMsg = new Any ( )
57
- const name = 'band. oracle.v1.MsgRequestData'
47
+ const name = 'oracle.v1.MsgRequestData'
58
48
anyMsg . pack ( msgRequest . serializeBinary ( ) , name , '/' )
59
49
60
50
expect ( msgRequest . toAny ( ) ) . toEqual ( anyMsg )
@@ -570,7 +560,7 @@ describe('MsgCreateDataSource', () => {
570
560
)
571
561
572
562
const anyMsg = new Any ( )
573
- const name = 'band. oracle.v1.MsgCreateDataSource'
563
+ const name = 'oracle.v1.MsgCreateDataSource'
574
564
anyMsg . pack ( msgCreateDs . serializeBinary ( ) , name , '/' )
575
565
576
566
expect ( msgCreateDs . toAny ( ) ) . toEqual ( anyMsg )
@@ -691,7 +681,7 @@ describe('MsgEditDataSource', () => {
691
681
)
692
682
693
683
const anyMsg = new Any ( )
694
- const name = 'band. oracle.v1.MsgEditDataSource'
684
+ const name = 'oracle.v1.MsgEditDataSource'
695
685
anyMsg . pack ( msgCreateDs . serializeBinary ( ) , name , '/' )
696
686
697
687
expect ( msgCreateDs . toAny ( ) ) . toEqual ( anyMsg )
@@ -768,7 +758,7 @@ describe('MsgCreateOracleScript', () => {
768
758
)
769
759
770
760
const anyMsg = new Any ( )
771
- const name = 'band. oracle.v1.MsgCreateOracleScript'
761
+ const name = 'oracle.v1.MsgCreateOracleScript'
772
762
anyMsg . pack ( msgCreateOs . serializeBinary ( ) , name , '/' )
773
763
expect ( msgCreateOs . toAny ( ) ) . toEqual ( anyMsg )
774
764
expect ( ( ) => msgCreateOs . validate ( ) ) . not . toThrow ( )
@@ -870,7 +860,7 @@ describe('MsgEditOracleScript', () => {
870
860
)
871
861
872
862
const anyMsg = new Any ( )
873
- const name = 'band. oracle.v1.MsgEditOracleScript'
863
+ const name = 'oracle.v1.MsgEditOracleScript'
874
864
anyMsg . pack ( msgEditOs . serializeBinary ( ) , name , '/' )
875
865
expect ( msgEditOs . toAny ( ) ) . toEqual ( anyMsg )
876
866
expect ( ( ) => msgEditOs . validate ( ) ) . not . toThrow ( )
@@ -963,167 +953,3 @@ describe('MsgDeposit', () => {
963
953
} )
964
954
} )
965
955
} )
966
-
967
- describe ( 'MsgVoteSignals' , ( ) => {
968
- let signal = new Signal ( )
969
- signal . setId ( 'crypto_prices.btcbusd' )
970
- signal . setPower ( 1 )
971
-
972
- it ( 'create successfully' , ( ) => {
973
- const msgVoteSignals = new MsgVoteSignals (
974
- 'band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c' ,
975
- [ signal ] ,
976
- )
977
- const anyMsg = new Any ( )
978
- const name = 'band.feeds.v1beta1.MsgVote'
979
- anyMsg . pack ( msgVoteSignals . serializeBinary ( ) , name , '/' )
980
-
981
- expect ( msgVoteSignals . toAny ( ) ) . toEqual ( anyMsg )
982
-
983
- expect ( ( ) => msgVoteSignals . validate ( ) ) . not . toThrow ( )
984
- } )
985
-
986
- it ( 'error MsgVoteSignals' , ( ) => {
987
- let msgs : MsgVoteSignals [ ] = [ ]
988
- let errorText : string [ ] = [ ]
989
-
990
- msgs . push ( new MsgVoteSignals ( '' , [ signal ] ) )
991
-
992
- errorText . push ( 'Voter address should not be an empty string' )
993
-
994
- msgs . forEach ( ( msg , index ) => {
995
- expect ( ( ) => {
996
- msg . validate ( )
997
- } ) . toThrowError ( errorText [ index ] )
998
- } )
999
- } )
1000
- } )
1001
-
1002
- describe ( 'MsgSubmitSignalPrice' , ( ) => {
1003
- const signalPrice = new SignalPrice ( )
1004
- signalPrice . setSignalId ( 'crypto_price.btcbusd' )
1005
- signalPrice . setPrice ( 1 )
1006
- signalPrice . setStatus ( 0 )
1007
-
1008
- it ( 'create successfully' , ( ) => {
1009
- const msgSubmitSignalPrice = new MsgSubmitSignalPrices (
1010
- 'bandvaloper1dqsqfh537nzdr3ue9whc9tk7zqre4322hkru33' ,
1011
- 1723027871382 ,
1012
- [ signalPrice ] ,
1013
- )
1014
-
1015
- const anyMsg = new Any ( )
1016
- const name = 'band.feeds.v1beta1.MsgSubmitSignalPrices'
1017
- anyMsg . pack ( msgSubmitSignalPrice . serializeBinary ( ) , name , '/' )
1018
-
1019
- expect ( msgSubmitSignalPrice . toAny ( ) ) . toEqual ( anyMsg )
1020
-
1021
- expect ( ( ) => msgSubmitSignalPrice . validate ( ) ) . not . toThrow ( )
1022
- } )
1023
-
1024
- it ( 'error MsgSubmitSignalPrice' , ( ) => {
1025
- let msgs : MsgSubmitSignalPrices [ ] = [ ]
1026
- let errorText : string [ ] = [ ]
1027
-
1028
- msgs . push ( new MsgSubmitSignalPrices ( '' , 1723027871382 , [ signalPrice ] ) )
1029
- msgs . push (
1030
- new MsgSubmitSignalPrices (
1031
- 'band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c' ,
1032
- 1723027871382 ,
1033
- [ signalPrice ] ,
1034
- ) ,
1035
- )
1036
-
1037
- errorText . push ( 'Validator address should not be an empty string' )
1038
- errorText . push ( 'invalid Bech32 prefix; expected bandvaloper, got band' )
1039
-
1040
- msgs . forEach ( ( msg , index ) => {
1041
- expect ( ( ) => {
1042
- msg . validate ( )
1043
- } ) . toThrowError ( errorText [ index ] )
1044
- } )
1045
- } )
1046
- } )
1047
-
1048
- describe ( 'MsgUpdateReferenceSourceConfig' , ( ) => {
1049
- const referenceSource = new ReferenceSourceConfig ( )
1050
- referenceSource . setRegistryIpfsHash (
1051
- 'QmTzQ1b4SijKVDe3XZPq3N5tHk3PvCjAosYtK6KDxDZXn6' ,
1052
- )
1053
- referenceSource . setRegistryVersion ( '1.1' )
1054
-
1055
- it ( 'create successfully' , ( ) => {
1056
- const msgUpdateReferenceSourceConfig = new MsgUpdateReferenceSourceConfig (
1057
- 'band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c' ,
1058
- referenceSource ,
1059
- )
1060
-
1061
- const anyMsg = new Any ( )
1062
- const name = 'band.feeds.v1beta1.MsgUpdateReferenceSourceConfig'
1063
- anyMsg . pack ( msgUpdateReferenceSourceConfig . serializeBinary ( ) , name , '/' )
1064
-
1065
- expect ( msgUpdateReferenceSourceConfig . toAny ( ) ) . toEqual ( anyMsg )
1066
-
1067
- expect ( ( ) => msgUpdateReferenceSourceConfig . validate ( ) ) . not . toThrow ( )
1068
- } )
1069
-
1070
- it ( 'error MsgUpdateReferenceSourceConfig' , ( ) => {
1071
- let msgs : MsgUpdateReferenceSourceConfig [ ] = [ ]
1072
- let errorText : string [ ] = [ ]
1073
-
1074
- msgs . push ( new MsgUpdateReferenceSourceConfig ( '' , referenceSource ) )
1075
-
1076
- errorText . push ( 'Authority address should not be an empty string' )
1077
-
1078
- msgs . forEach ( ( msg , index ) => {
1079
- expect ( ( ) => {
1080
- msg . validate ( )
1081
- } ) . toThrowError ( errorText [ index ] )
1082
- } )
1083
- } )
1084
- } )
1085
-
1086
- describe ( 'MsgUpdateParams' , ( ) => {
1087
- const param = new Params ( )
1088
- param . setAdmin ( 'band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c' )
1089
- param . setAllowableBlockTimeDiscrepancy ( 1 )
1090
- param . setGracePeriod ( 1 )
1091
- param . setMinInterval ( 1 )
1092
- param . setMaxInterval ( 1 )
1093
- param . setPowerStepThreshold ( 1 )
1094
- param . setMaxCurrentFeeds ( 1 )
1095
- param . setCooldownTime ( 1 )
1096
- param . setMinDeviationBasisPoint ( 1 )
1097
- param . setMaxDeviationBasisPoint ( 1 )
1098
- param . setCurrentFeedsUpdateInterval ( 1 )
1099
-
1100
- it ( 'create successfully' , ( ) => {
1101
- const msgUpdateParams = new MsgUpdateParams (
1102
- 'band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c' ,
1103
- param ,
1104
- )
1105
-
1106
- const anyMsg = new Any ( )
1107
- const name = 'band.feeds.v1beta1.MsgUpdateParams'
1108
- anyMsg . pack ( msgUpdateParams . serializeBinary ( ) , name , '/' )
1109
-
1110
- expect ( msgUpdateParams . toAny ( ) ) . toEqual ( anyMsg )
1111
-
1112
- expect ( ( ) => msgUpdateParams . validate ( ) ) . not . toThrow ( )
1113
- } )
1114
-
1115
- it ( 'error MsgUpdateParams' , ( ) => {
1116
- let msgs : MsgUpdateParams [ ] = [ ]
1117
- let errorText : string [ ] = [ ]
1118
-
1119
- msgs . push ( new MsgUpdateParams ( '' , param ) )
1120
-
1121
- errorText . push ( 'Admin address should not be an empty string' )
1122
-
1123
- msgs . forEach ( ( msg , index ) => {
1124
- expect ( ( ) => {
1125
- msg . validate ( )
1126
- } ) . toThrowError ( errorText [ index ] )
1127
- } )
1128
- } )
1129
- } )
0 commit comments