c-ipfs/test/storage/test_blockstore.h
John Jones b462d9ef53 More storage implementation
Successfully writing to lightningdb. Now to pull it back out. Also need
to write to the blockstore.
2016-11-30 11:46:41 -05:00

20 lines
436 B
C

#include <string.h>
#include "ipfs/blocks/blockstore.h"
#include "ipfs/blocks/block.h"
int test_blockstore_put() {
const unsigned char* input_string = "Hello, World!";
struct Block* input_block;
int retVal = 0;
retVal = ipfs_blocks_block_new(input_string, strlen((const char*)input_string) + 1, &input_block);
if (retVal == 0)
return 0;
retVal = ipfs_blockstore_put(input_block);
if (retVal == 0)
return 0;
return 1;
}