dapphub / dpack

simple lockfile for your dapp's addresses and artifacts
46 stars 9 forks source link

putIpfsJson uses pin param and pins v1 cid #43

Closed stobiewan closed 2 years ago

stobiewan commented 2 years ago

This makes a few functional changes. In add() pin defaults to true, so previously putIpfsJson was always pinning and ignored the pin param.

The CID was converted to V1 after pinning, so the V0 CID was being pinned. Now that V1 is used in add the V1 CID will be pinned if the pin param is true.

Using V1 directly will produce different CIDs because V0 always used dag-pb for the codec and that was kept in the converted value, but now the raw codec will be used when adding with V1.

Also the toV1 conversion can be skipped as version is passed in AddOptions now.