diff --git a/pkg/client-sdk/client.go b/pkg/client-sdk/client.go index a371e7462..fcd36e9ac 100644 --- a/pkg/client-sdk/client.go +++ b/pkg/client-sdk/client.go @@ -110,6 +110,7 @@ func (a *arkClient) InitWithWallet( ClientType: args.ClientType, Network: network, RoundLifetime: info.RoundLifetime, + RoundInterval: info.RoundInterval, UnilateralExitDelay: info.UnilateralExitDelay, Dust: info.Dust, BoardingDescriptorTemplate: info.BoardingDescriptorTemplate, @@ -174,6 +175,7 @@ func (a *arkClient) Init( ClientType: args.ClientType, Network: network, RoundLifetime: info.RoundLifetime, + RoundInterval: info.RoundInterval, UnilateralExitDelay: info.UnilateralExitDelay, Dust: info.Dust, BoardingDescriptorTemplate: info.BoardingDescriptorTemplate, diff --git a/pkg/client-sdk/store/file/store.go b/pkg/client-sdk/store/file/store.go index caa51b05f..92e990fba 100644 --- a/pkg/client-sdk/store/file/store.go +++ b/pkg/client-sdk/store/file/store.go @@ -27,6 +27,7 @@ type storeData struct { ClientType string `json:"client_type"` Network string `json:"network"` RoundLifetime string `json:"round_lifetime"` + RoundInterval string `json:"round_interval"` UnilateralExitDelay string `json:"unilateral_exit_delay"` Dust string `json:"dust"` BoardingDescriptorTemplate string `json:"boarding_descriptor_template"` @@ -40,6 +41,7 @@ func (d storeData) isEmpty() bool { func (d storeData) decode() store.StoreData { network := utils.NetworkFromString(d.Network) roundLifetime, _ := strconv.Atoi(d.RoundLifetime) + roundInterval, _ := strconv.Atoi(d.RoundInterval) unilateralExitDelay, _ := strconv.Atoi(d.UnilateralExitDelay) dust, _ := strconv.Atoi(d.Dust) buf, _ := hex.DecodeString(d.AspPubkey) @@ -53,6 +55,7 @@ func (d storeData) decode() store.StoreData { Network: network, RoundLifetime: int64(roundLifetime), UnilateralExitDelay: int64(unilateralExitDelay), + RoundInterval: int64(roundInterval), Dust: uint64(dust), BoardingDescriptorTemplate: d.BoardingDescriptorTemplate, ExplorerURL: explorerURL, @@ -67,6 +70,7 @@ func (d storeData) asMap() map[string]string { "client_type": d.ClientType, "network": d.Network, "round_lifetime": d.RoundLifetime, + "round_interval": d.RoundInterval, "unilateral_exit_delay": d.UnilateralExitDelay, "dust": d.Dust, "boarding_descriptor_template": d.BoardingDescriptorTemplate, @@ -113,6 +117,7 @@ func (s *Store) AddData(ctx context.Context, data store.StoreData) error { ClientType: data.ClientType, Network: data.Network.Name, RoundLifetime: fmt.Sprintf("%d", data.RoundLifetime), + RoundInterval: fmt.Sprintf("%d", data.RoundInterval), UnilateralExitDelay: fmt.Sprintf("%d", data.UnilateralExitDelay), Dust: fmt.Sprintf("%d", data.Dust), BoardingDescriptorTemplate: data.BoardingDescriptorTemplate, diff --git a/pkg/client-sdk/store/store.go b/pkg/client-sdk/store/store.go index aca1c23bf..963379d73 100644 --- a/pkg/client-sdk/store/store.go +++ b/pkg/client-sdk/store/store.go @@ -19,6 +19,7 @@ type StoreData struct { ClientType string Network common.Network RoundLifetime int64 + RoundInterval int64 UnilateralExitDelay int64 Dust uint64 BoardingDescriptorTemplate string diff --git a/pkg/client-sdk/store/store_test.go b/pkg/client-sdk/store/store_test.go index 73c9e2d3e..96e82fc75 100644 --- a/pkg/client-sdk/store/store_test.go +++ b/pkg/client-sdk/store/store_test.go @@ -24,6 +24,7 @@ func TestStore(t *testing.T) { ClientType: client.GrpcClient, Network: common.LiquidRegTest, RoundLifetime: 512, + RoundInterval: 10, UnilateralExitDelay: 512, Dust: 1000, BoardingDescriptorTemplate: "tr(0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0,{ and(pk(873079a0091c9b16abd1f8c508320b07f0d50144d09ccd792ce9c915dac60465), pk(USER)), and(older(604672), pk(USER)) })", diff --git a/pkg/client-sdk/wallet/wallet_test.go b/pkg/client-sdk/wallet/wallet_test.go index fe6b2f40c..7c7382ce1 100644 --- a/pkg/client-sdk/wallet/wallet_test.go +++ b/pkg/client-sdk/wallet/wallet_test.go @@ -27,6 +27,7 @@ func TestWallet(t *testing.T) { ClientType: client.GrpcClient, Network: common.LiquidRegTest, RoundLifetime: 512, + RoundInterval: 10, UnilateralExitDelay: 512, Dust: 1000, BoardingDescriptorTemplate: "tr(0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0,{ and(pk(873079a0091c9b16abd1f8c508320b07f0d50144d09ccd792ce9c915dac60465), pk(USER)), and(older(604672), pk(USER)) })", diff --git a/pkg/client-sdk/wasm/browser/config_store.go b/pkg/client-sdk/wasm/browser/config_store.go index fc3d8c9e5..7b08fb38b 100644 --- a/pkg/client-sdk/wasm/browser/config_store.go +++ b/pkg/client-sdk/wasm/browser/config_store.go @@ -28,6 +28,7 @@ type storeData struct { ExplorerURL string `json:"explorer_url"` Network string `json:"network"` RoundLifetime string `json:"round_lifetime"` + RoundInterval string `json:"round_interval"` UnilateralExitDelay string `json:"unilateral_exit_delay"` Dust string `json:"dust"` } @@ -57,6 +58,7 @@ func (s *localStorageStore) AddData(ctx context.Context, data store.StoreData) e ClientType: data.ClientType, Network: data.Network.Name, RoundLifetime: fmt.Sprintf("%d", data.RoundLifetime), + RoundInterval: fmt.Sprintf("%d", data.RoundInterval), UnilateralExitDelay: fmt.Sprintf("%d", data.UnilateralExitDelay), Dust: fmt.Sprintf("%d", data.Dust), } @@ -82,6 +84,7 @@ func (s *localStorageStore) GetData(ctx context.Context) (*store.StoreData, erro } network := utils.NetworkFromString(s.store.Call("getItem", "network").String()) roundLifetime, _ := strconv.Atoi(s.store.Call("getItem", "round_lifetime").String()) + roundInterval, _ := strconv.Atoi(s.store.Call("getItem", "round_interval").String()) unilateralExitDelay, _ := strconv.Atoi(s.store.Call("getItem", "unilateral_exit_delay").String()) dust, _ := strconv.Atoi(s.store.Call("getItem", "min_relay_fee").String()) @@ -92,6 +95,7 @@ func (s *localStorageStore) GetData(ctx context.Context) (*store.StoreData, erro ClientType: s.store.Call("getItem", "client_type").String(), Network: network, RoundLifetime: int64(roundLifetime), + RoundInterval: int64(roundInterval), UnilateralExitDelay: int64(unilateralExitDelay), Dust: uint64(dust), }, nil