Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SetarehGhorshi committed Jan 3, 2024
1 parent a909c32 commit 548300a
Show file tree
Hide file tree
Showing 18 changed files with 736 additions and 424 deletions.
7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
github.com/CosmWasm/wasmd v0.40.0
github.com/FairBlock/DistributedIBE v0.0.0-20230528025616-f58fb2b93eaf
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
Expand Down Expand Up @@ -34,16 +33,12 @@ require github.com/cosmos/gogoproto v1.4.10

require (
cosmossdk.io/tools/rosetta v0.2.1 // indirect
github.com/CosmWasm/wasmvm v1.4.1 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
)

require (
Expand Down Expand Up @@ -204,5 +199,5 @@ replace (
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

github.com/tendermint/tendermint v0.34.27 => ../tendermint-v0.34.27-terra.rc.1
)
8 changes: 0 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmd v0.40.0 h1:3Vvq1m8dPQdvZR+QJc86VIx6QoWAEVnuHxqBPshJvyo=
github.com/CosmWasm/wasmd v0.40.0/go.mod h1:SuxskRBB7+bpwXGhUXaEfdpjg5WKpdxBy7Tm36VRMUU=
github.com/CosmWasm/wasmvm v1.4.1 h1:YgodVlBrXa2HJZzOXjWDH0EIRwQzK3zuA73dDPRRLS4=
github.com/CosmWasm/wasmvm v1.4.1/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
Expand Down Expand Up @@ -462,8 +458,6 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -642,7 +636,6 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down Expand Up @@ -967,7 +960,6 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8=
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk=
Expand Down
1 change: 1 addition & 0 deletions ibc-rs
Submodule ibc-rs added at af0213
Binary file modified testutil/conditionalenc-tesnet/encrypter/encrypter
Binary file not shown.
41 changes: 23 additions & 18 deletions testutil/conditionalenc-tesnet/encrypter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"encoding/hex"
"fmt"
"os"
"time"
types1 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
//"encoding/json"
//"time"
//types1 "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
enc "github.com/FairBlock/DistributedIBE/encryption"
sdk "github.com/cosmos/cosmos-sdk/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
//sdk "github.com/cosmos/cosmos-sdk/types"
//transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
bls "github.com/drand/kyber-bls12381"
)

Expand All @@ -32,25 +33,29 @@ func main() {
panic(fmt.Sprintf("\nError unmarshalling public key: %s\n", err.Error()))
}

// coin := am.keeper.MinGasPrice(ctx)
// coin := am.keeper.MinGasPrice(ctx)
// coin.Amount = sdk.NewIntFromUint64(500)
coin := sdk.Coin{Amount: sdk.NewIntFromUint64(20000), Denom: "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518"}
cosmWasmPacketData := transfertypes.MsgTransfer{
SourcePort: "transfer",
SourceChannel: "channel-1",
Token: coin,
Sender: "fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c",
Receiver: "osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqw",
TimeoutTimestamp: uint64(time.Now().UnixNano()+int64(280000*time.Minute)),
TimeoutHeight: types1.NewHeight(100000000000,1000000000000),
Memo: `{"wasm":{"contract":"osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqw", "msg":{"swap_with_action":{"swap_msg":{"token_out_min_amount":"10","path":[{"pool_id":"74","token_out_denom":"uion"}]},"after_swap_action":{"ibc_transfer":{"receiver":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","channel":"channel-0"}},"local_fallback_address":"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj"}}}}`,
}
plain,_ := cosmWasmPacketData.Marshal()
// coin := sdk.Coin{Amount: sdk.NewIntFromUint64(20000), Denom: "ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B"}
// cosmWasmPacketData := transfertypes.MsgTransfer{
// SourcePort: "transfer",
// SourceChannel: "channel-1",
// Token: coin,
// Sender: "fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c",
// Receiver: "osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqu",
// TimeoutTimestamp: uint64(time.Now().UnixNano()+int64(280000*time.Minute)),
// TimeoutHeight: types1.NewHeight(100000000000,1000000000000),
// Memo: `{"wasm":{"contract":"osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqu", "msg":{"swap_with_action":{"swap_msg":{"token_out_min_amount":"10","path":[{"pool_id":"74","token_out_denom":"uion"}]},"after_swap_action":{"ibc_transfer":{"receiver":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","channel":"channel-4486"}},"local_fallback_address":"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj"}}}}`,
// }
// var packet transfertypes.MsgTransfer
f := `{"source_port":"transfer","source_channel":"channel-1","token":{"denom":"ibc/0471F1C4E7AFD3F07702BEF6DC365268D64570F7C1FDC98EA6098DD6DE59817B","amount":"20000"},"sender":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","receiver":"osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqw","timeout_height":{"revision_number":"1000000000000","revision_height":"10000000000000"},"timeout_timestamp":"1702572909444761679","memo":"{\"wasm\":{\"contract\":\"osmo1zl9ztmwe2wcdvv9std8xn06mdaqaqm789rutmazfh3z869zcax4sv0ctqw\", \"msg\":{\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"74\",\"token_out_denom\":\"uion\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-4503\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"}`
// json.Unmarshal([]byte(f),&packet)
// fmt.Println(cosmWasmPacketData.TimeoutHeight)
// plain,_ := packet.Marshal()
//plain := []byte{10,8,116,114,97,110,115,102,101,114,18,9,99,104,97,110,110,101,108,45,49,26,10,10,3,102,114,116,18,3,53,48,48,34,44,102,97,105,114,121,49,112,54,99,97,53,55,99,117,53,117,56,57,113,122,102,53,56,107,114,120,103,120,97,101,122,112,52,119,109,57,118,117,55,108,117,114,51,99,42,63,111,115,109,111,49,52,104,106,50,116,97,118,113,56,102,112,101,115,100,119,120,120,99,117,52,52,114,116,121,51,104,104,57,48,118,104,117,106,114,118,99,109,115,116,108,52,122,114,51,116,120,109,102,118,119,57,115,113,50,114,57,103,57,50,13,8,128,200,175,160,37,16,128,208,219,195,244,2,56,230,150,181,146,230,198,215,221,23,66,143,3,123,34,119,97,115,109,34,58,123,34,99,111,110,116,114,97,99,116,34,58,34,111,115,109,111,49,52,104,106,50,116,97,118,113,56,102,112,101,115,100,119,120,120,99,117,52,52,114,116,121,51,104,104,57,48,118,104,117,106,114,118,99,109,115,116,108,52,122,114,51,116,120,109,102,118,119,57,115,113,50,114,57,103,57,34,44,32,34,109,115,103,34,58,123,34,115,119,97,112,95,119,105,116,104,95,97,99,116,105,111,110,34,58,123,34,115,119,97,112,95,109,115,103,34,58,123,34,116,111,107,101,110,95,111,117,116,95,109,105,110,95,97,109,111,117,110,116,34,58,34,49,48,34,44,34,112,97,116,104,34,58,91,123,34,112,111,111,108,95,105,100,34,58,34,49,34,44,34,116,111,107,101,110,95,111,117,116,95,100,101,110,111,109,34,58,34,117,111,115,109,111,34,125,93,125,44,34,97,102,116,101,114,95,115,119,97,112,95,97,99,116,105,111,110,34,58,123,34,105,98,99,95,116,114,97,110,115,102,101,114,34,58,123,34,114,101,99,101,105,118,101,114,34,58,34,102,97,105,114,121,49,112,54,99,97,53,55,99,117,53,117,56,57,113,122,102,53,56,107,114,120,103,120,97,101,122,112,52,119,109,57,118,117,55,108,117,114,51,99,34,44,34,99,104,97,110,110,101,108,34,58,34,99,104,97,110,110,101,108,45,48,34,125,125,44,34,108,111,99,97,108,95,102,97,108,108,98,97,99,107,95,97,100,100,114,101,115,115,34,58,34,111,115,109,111,49,50,115,109,120,50,119,100,108,121,116,116,118,121,122,118,122,103,53,52,121,50,118,110,113,119,113,50,113,106,97,116,101,117,102,55,116,104,106,34,125,125,125,125}

var destCipherData bytes.Buffer
var plainTextBuffer bytes.Buffer
_, err = plainTextBuffer.WriteString(string(plain))
_, err = plainTextBuffer.WriteString(f)
if err != nil {
panic(fmt.Sprintf("\nError writing plaintext string to buffer: %s\n", err.Error()))
}
Expand Down
2 changes: 1 addition & 1 deletion testutil/conditionalenc-tesnet/mnemonic-osmosis.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bottom loan skill merry east cradle onion journey palm apology verb edit desert impose absurd oil bubble sweet glove shallow size build burst effort
season opinion market ability front surprise panda rude simple rubber meadow cactus side uncle stadium already imitate retreat embark canyon amount rare access spoil
6 changes: 3 additions & 3 deletions testutil/conditionalenc-tesnet/relayer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ address_type = { derivation = 'cosmos' }
[[chains]]
id = 'fairytest-${i}'
rpc_addr = 'http://localhost:26659'
grpc_addr = 'http://localhost:9092'
event_source = { url = "ws://localhost:26659/websocket", batch_delay = '50ms' , mode = "push" }
rpc_addr = 'http://0.0.0.0:26659'
grpc_addr = 'http://0.0.0.0:9092'
event_source = { url = "ws://0.0.0.0:26659/websocket", batch_delay = '50ms' , mode = "push" }
rpc_timeout = '50s'
account_prefix = 'fairy'
key_name = 'requester'
Expand Down
49 changes: 28 additions & 21 deletions testutil/conditionalenc-tesnet/send-tx.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
read -p "Enter the value for id: " i

enc=$(./encrypter/encrypter ${i} a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 "hi")
# '{
# "source_port": "transfer",
# "source_channel": "channel-1",
# "token":{
# "denom": "frt",
# "amount": "500"
# },
# "sender": "fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c",
# "receiver": "osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9",
# "timeout_height":{
# "revision_number": "10000000000",
# "revision_height": "100000000000"
# },
# "timeout_timestamp": "1699052860444761679",
# "memo": "{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"
# }')
#'{"source_port":"transfer","source_channel":"channel-1","token":{"denom":"frt","amount":"500"},"sender":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","receiver":"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9","timeout_height":{"revision_number":10000000000,"revision_height":100000000000},"timeout_timestamp":1699052860444761679,"memo":"{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"}}')
#'{"denom":"frt","amount":"130","sender":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","receiver":"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9","memo":"{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"}')
# cd ./encrypter

# go build

# cd ..


enc=$(./encrypter/encrypter ${i} a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 "test")
# # # '{
# # # "source_port": "transfer",
# # # "source_channel": "channel-1",
# # # "token":{
# # # "denom": "frt",
# # # "amount": "500"
# # # },
# # # "sender": "fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c",
# # # "receiver": "osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9",
# # # "timeout_height":{
# # # "revision_number": "10000000000",
# # # "revision_height": "100000000000"
# # # },
# # # "timeout_timestamp": "1699052860444761679",
# # # "memo": "{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"
# # # }')
# # #'{"source_port":"transfer","source_channel":"channel-1","token":{"denom":"frt","amount":"500"},"sender":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","receiver":"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9","timeout_height":{"revision_number":10000000000,"revision_height":100000000000},"timeout_timestamp":1699052860444761679,"memo":"{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"}}')
# # #'{"denom":"frt","amount":"130","sender":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c","receiver":"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9","memo":"{\"wasm\": {\"contract\": \"osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9\", \"msg\": {\"swap_with_action\":{\"swap_msg\":{\"token_out_min_amount\":\"10\",\"path\":[{\"pool_id\":\"1\",\"token_out_denom\":\"uosmo\"}]},\"after_swap_action\":{\"ibc_transfer\":{\"receiver\":\"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c\",\"channel\":\"channel-0\"}},\"local_fallback_address\":\"osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj\"}}}}"}')


echo "${enc}"

../../fairyringd tx conditionalenc submit-encrypted-tx ${enc} ${i} --node tcp://127.0.0.1:26659 -b sync -y --from star
../../fairyringd tx conditionalenc submit-encrypted-tx ${enc} ${i} --node tcp://127.0.0.1:26659 -b sync -y --from star
sleep 5
../../fairyringd tx keyshare create-latest-pub-key a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 --node tcp://127.0.0.1:26659 -b sync -y --from star

output=$($HOME/job/ShareGenerator/ShareGenerator derive 2ecab484b7a96eb1a4d9113b03cf09459c79c178ce3098baa2f8eb2bdcbec920 0 ${i} | jq '.')
output=$($HOME/ShareGenerator/ShareGenerator derive 2ecab484b7a96eb1a4d9113b03cf09459c79c178ce3098baa2f8eb2bdcbec920 0 ${i} | jq '.')

# Using jq to parse the JSON and extract the value of KeyShare
share=$(echo "$output" | jq -r '.KeyShare')
Expand Down
6 changes: 2 additions & 4 deletions testutil/conditionalenc-tesnet/start-fairy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo shrug make inmate anchor acid clock morning stage fiction build chef copy o
GENESIS_FILE_PATH="$HOME/.fairyring/config/genesis.json"

# Use jq to update "symbol_requests" in the genesis.json file
jq '.app_state.pricefeed.symbol_requests = [{"symbol": "OSMO", "oracle_script_id": 396, "block_interval": 1, "price_step": 100}]' $GENESIS_FILE_PATH > temp.json
jq '.app_state.pricefeed.symbol_requests = [{"symbol": "OSMO", "oracle_script_id": 396, "block_interval": 2, "price_step": 1000000}]' $GENESIS_FILE_PATH > temp.json
jq '.app_state.keyshare.params.trusted_addresses = ["fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c"]' temp.json > temp2.json

jq '.app_state.keyshare.validatorSetList = [{"validator":"fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c", "index": "fairy1p6ca57cu5u89qzf58krxgxaezp4wm9vu7lur3c", "isActive":true}]' temp2.json > temp3.json
Expand All @@ -54,6 +54,4 @@ mv updated_genesis.json $GENESIS_FILE_PATH
rm temp.json


./fairyringd start --rpc.laddr tcp://127.0.0.1:26659 --grpc.address localhost:9092 --grpc-web.address localhost:9093 --api.address tcp://localhost:1318


./fairyringd start --rpc.laddr tcp://0.0.0.0:26659 --grpc.address 0.0.0.0:9092 --grpc-web.address 0.0.0.0:9093 --api.address tcp://0.0.0.0:1318
2 changes: 1 addition & 1 deletion testutil/conditionalenc/send-tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ echo "${enc}"
sleep 5
../../fairyringd tx keyshare create-latest-pub-key a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 a6798cf7364ba5e8337584394bf9c6d4970a174603aab18f06ed80ade5f65194e51522170814d2c38b68c2703bfb7ca0 --node tcp://127.0.0.1:26659 -b sync -y --from star

output=$($HOME/job/ShareGenerator/ShareGenerator derive 2ecab484b7a96eb1a4d9113b03cf09459c79c178ce3098baa2f8eb2bdcbec920 0 ${i} | jq '.')
output=$($HOME/ShareGenerator derive 2ecab484b7a96eb1a4d9113b03cf09459c79c178ce3098baa2f8eb2bdcbec920 0 ${i} | jq '.')

# Using jq to parse the JSON and extract the value of KeyShare
share=$(echo "$output" | jq -r '.KeyShare')
Expand Down
Loading

0 comments on commit 548300a

Please sign in to comment.