Skip to content

Commit

Permalink
fix tests (#4)
Browse files Browse the repository at this point in the history
* make lib compiling

* removed unnecessary libs

* moved constant to proper place
  • Loading branch information
szhygulin authored May 18, 2024
1 parent 0ad6954 commit 35f9a6b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
[submodule "lib/bitcoin-spv"]
path = lib/bitcoin-spv
url = https://github.com/summa-tx/bitcoin-spv
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/foundry-devops"]
path = lib/foundry-devops
url = https://github.com/Cyfrin/foundry-devops
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/elliptic-curve-solidity"]
path = lib/elliptic-curve-solidity
url = https://github.com/witnet/elliptic-curve-solidity
1 change: 0 additions & 1 deletion lib/bitcoin-spv
Submodule bitcoin-spv deleted from 362cfd
1 change: 0 additions & 1 deletion lib/solmate
Submodule solmate deleted from c89230
8 changes: 4 additions & 4 deletions src/BTCDepositAddressDeriver.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;
pragma solidity ^0.8.18;

import {Deriver} from "./Deriver.sol";
import {Bech32m} from "./Bech32m.sol";
Expand Down Expand Up @@ -54,9 +54,9 @@ contract BTCDepositAddressDeriver {
}

function setSeed(
string memory _btcAddr1,
string memory _btcAddr2,
string memory _hrp
string calldata _btcAddr1,
string calldata _btcAddr2,
string calldata _hrp
) public virtual {
networkHrp = _hrp;
(p1x, p1y) = parseBTCTaprootAddress(_hrp, _btcAddr1);
Expand Down
8 changes: 4 additions & 4 deletions src/Bech32m.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TODO(mkl): what License?
// based on https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki
// https://github.com/sipa/bech32/blob/master/ref/python/segwit_addr.py
pragma solidity ^0.8;
pragma solidity ^0.8.18;

error EncodingIsUnknown();

Expand Down Expand Up @@ -64,6 +64,9 @@ library Bech32m {
// BECH32M_CONST = 0x2bc830a3
uint256 public constant BECH32M_CONST = 0x2bc830a3;

// 1 byte for the separator
bytes1 public constant SEPARATOR = bytes1(0x31);

// TODO(mkl): port implementation from C++ reference because it is more readable
// https://github.com/sipa/bech32/blob/master/ref/c%2B%2B/bech32.cpp
// /** This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to
Expand Down Expand Up @@ -267,9 +270,6 @@ library Bech32m {

// <hrp> 1 <data-5bit-format> <6bytes of chk-5bit-format>

// 1 byte for the separator
bytes1 constant SEPARATOR = bytes1(0x31);

// reuse data and chk arrays to modify data in place to save gas

for (uint i = 0; i < data.length; i += 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/Deriver.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity ^0.8.18;

import {EllipticCurve} from "../lib/elliptic-curve-solidity/contracts/EllipticCurve.sol";

Expand Down

0 comments on commit 35f9a6b

Please sign in to comment.